Skip to content

Commit af23b45

Browse files
Developer089claude
andcommitted
Add config_entry_only schema and ignore brands in HACS CI
- Define CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN) and drop the empty async_setup, silencing the hassfest CONFIG_SCHEMA notice. - Ignore the HACS "brands" check (only required for default-store submission; this is installed as a custom repository). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 7080a01 commit af23b45

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎.github/workflows/validate.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ jobs:
2929
uses: hacs/action@main
3030
with:
3131
category: integration
32+
# "brands" only applies to submission into the default HACS store
33+
# (requires registering the domain in home-assistant/brands).
34+
# This repo is installed as a HACS *custom repository*, so it is
35+
# ignored here. Remove this line before submitting to the store.
36+
ignore: brands

‎custom_components/deye_modbus/__init__.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from homeassistant.core import HomeAssistant, ServiceCall
66
from homeassistant.config_entries import ConfigEntry
77
from homeassistant.const import Platform, CONF_HOST, CONF_PORT
8+
import homeassistant.helpers.config_validation as cv
89

910
from .const import (
1011
DOMAIN, CONF_UNIT_ID, CONF_SCAN_INTERVAL, CONF_MODEL, DEFAULT_SCAN_SECONDS,
@@ -20,6 +21,9 @@
2021
_LOGGER = logging.getLogger(__name__)
2122
PLATFORMS: list[Platform] = [Platform.SENSOR, Platform.SWITCH, Platform.SELECT, Platform.NUMBER]
2223

24+
# This integration is set up only via the UI config flow (no YAML config).
25+
CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
26+
2327
# Fields accepted by RegisterDef - anything else in the YAML is ignored.
2428
_REGISTER_FIELDS = {
2529
"name", "unique_id", "register_type", "address", "count", "scale", "offset",
@@ -28,10 +32,6 @@
2832
}
2933

3034

31-
async def async_setup(hass, config):
32-
return True
33-
34-
3535
def _ensure_uid(base: str | None, prefix: str, address: int) -> str:
3636
base = (base or "").strip()
3737
return base if base else f"{prefix}_{address}"

0 commit comments

Comments
 (0)