Skip to content

Commit

Permalink
Tidy up config
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Dec 14, 2023
1 parent 674f7d8 commit e9ba700
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ Restart Home Assistant
Add the following entry to your ```configuration.yaml```
```
battery_notes:
enable_autodiscovery: true
```
Restart Home Assistant a final time
In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Battery Notes"
Expand Down
18 changes: 18 additions & 0 deletions custom_components/battery_notes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@

import logging

import homeassistant.helpers.config_validation as cv
import voluptuous as vol

from awesomeversion.awesomeversion import AwesomeVersion
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
Expand All @@ -21,12 +24,27 @@
DOMAIN_CONFIG,
PLATFORMS,
CONF_ENABLE_AUTODISCOVERY,
CONF_LIBRARY,
)

MIN_HA_VERSION = "2023.7"

_LOGGER = logging.getLogger(__name__)

CONFIG_SCHEMA = vol.Schema(
{
DOMAIN: vol.All(
vol.Schema(
{
vol.Optional(CONF_ENABLE_AUTODISCOVERY, default=True): cv.boolean,
vol.Optional(CONF_LIBRARY, default="library.json"): cv.string,
},
),
),
},
extra=vol.ALLOW_EXTRA,
)


async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Integration setup."""
Expand Down
2 changes: 1 addition & 1 deletion custom_components/battery_notes/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"integration_type": "device",
"iot_class": "calculated",
"issue_tracker": "https://github.com/andrew-codechimp/ha-battery-notes/issues",
"version": "1.1.1"
"version": "1.1.2"
}

0 comments on commit e9ba700

Please sign in to comment.