Skip to content

Commit e9ba700

Browse files
Tidy up config
1 parent 674f7d8 commit e9ba700

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Restart Home Assistant
3737
Add the following entry to your ```configuration.yaml```
3838
```
3939
battery_notes:
40-
enable_autodiscovery: true
4140
```
4241
Restart Home Assistant a final time
4342
In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Battery Notes"

custom_components/battery_notes/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
import logging
99

10+
import homeassistant.helpers.config_validation as cv
11+
import voluptuous as vol
12+
1013
from awesomeversion.awesomeversion import AwesomeVersion
1114
from homeassistant.config_entries import ConfigEntry
1215
from homeassistant.core import HomeAssistant, callback
@@ -21,12 +24,27 @@
2124
DOMAIN_CONFIG,
2225
PLATFORMS,
2326
CONF_ENABLE_AUTODISCOVERY,
27+
CONF_LIBRARY,
2428
)
2529

2630
MIN_HA_VERSION = "2023.7"
2731

2832
_LOGGER = logging.getLogger(__name__)
2933

34+
CONFIG_SCHEMA = vol.Schema(
35+
{
36+
DOMAIN: vol.All(
37+
vol.Schema(
38+
{
39+
vol.Optional(CONF_ENABLE_AUTODISCOVERY, default=True): cv.boolean,
40+
vol.Optional(CONF_LIBRARY, default="library.json"): cv.string,
41+
},
42+
),
43+
),
44+
},
45+
extra=vol.ALLOW_EXTRA,
46+
)
47+
3048

3149
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
3250
"""Integration setup."""

custom_components/battery_notes/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
"integration_type": "device",
1010
"iot_class": "calculated",
1111
"issue_tracker": "https://github.com/andrew-codechimp/ha-battery-notes/issues",
12-
"version": "1.1.1"
12+
"version": "1.1.2"
1313
}

0 commit comments

Comments
 (0)