Skip to content

Commit

Permalink
default values
Browse files Browse the repository at this point in the history
  • Loading branch information
bhuebschen committed Jun 30, 2024
1 parent a62a3d5 commit 305324a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/delayed_action/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{
DOMAIN: vol.Schema(
{
vol.Optional(CONF_DOMAINS, default=[]): vol.All(cv.ensure_list, [cv.string]),
vol.Optional(CONF_DOMAINS, default=["automation", "climate", "cover", "fan", "humidifier", "light", "lock", "media_player", "script", "switch", "vacuum", "water_heater"]): vol.All(cv.ensure_list, [cv.string]),
}
)
},
Expand All @@ -49,7 +49,7 @@
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Delayed Action component."""
_LOGGER.info("Setting up Delayed Action component")
hass.data[DOMAIN] = {"tasks": {}, "domains": config.get(DOMAIN, {}).get(CONF_DOMAINS, [])}
hass.data[DOMAIN] = {"tasks": {}, "domains": config.get(DOMAIN, {}).get(CONF_DOMAINS, ["automation", "climate", "cover", "fan", "humidifier", "light", "lock", "media_player", "script", "switch", "vacuum", "water_heater"])}

async def handle_event(event):
hass.bus.fire(f"{DOMAIN}_get_config_response", event.data)
Expand All @@ -62,7 +62,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
_LOGGER.info("Setting up Delayed Action from config entry")

config = entry.options
hass.data[DOMAIN]["domains"] = config.get(CONF_DOMAINS, [])
hass.data[DOMAIN]["domains"] = config.get(CONF_DOMAINS, ["automation", "climate", "cover", "fan", "humidifier", "light", "lock", "media_player", "script", "switch", "vacuum", "water_heater"])

_LOGGER.info("Delayed Action component setup complete")

Expand Down Expand Up @@ -207,7 +207,7 @@ def _serialize_actions(actions):
def serialize_config(config):
"""Serialize the domains."""
serialized = {}
serialized[CONF_DOMAINS] = config.get(CONF_DOMAINS, [])
serialized[CONF_DOMAINS] = config.get(CONF_DOMAINS, ["automation", "climate", "cover", "fan", "humidifier", "light", "lock", "media_player", "script", "switch", "vacuum", "water_heater"])
return serialized

hass.services.async_register(DOMAIN, SERVICE_DELAYED_ACTION, handle_delayed_action, schema=SERVICE_DELAY_SCHEMA)
Expand Down

0 comments on commit 305324a

Please sign in to comment.