feat: Add config flow for SmartIR integration with multi-step UI wizard
- Implemented a new config flow in `config_flow.py` for SmartIR, allowing users to select platforms, controllers, and devices through a guided interface. - Added support for new device codes in `codes_index.json` for Apton and Andersson manufacturers. - Enhanced fan, light, and media player components to support setup from config entries. - Introduced `strings.json` and `translations/en.json` for improved localization of the configuration steps. - Created a tool `build_index.py` to rebuild the `codes_index.json` from individual device JSON files. - Updated `smartir_capture.py` to handle single-code modes and excluded modes for better device configuration. - Added `iot_class` and `config_flow` attributes in `manifest.json` to support the new configuration flow.
This commit is contained in:
@@ -52,6 +52,15 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Optional(CONF_POWER_SENSOR_RESTORE_STATE, default=False): cv.boolean
|
||||
})
|
||||
|
||||
|
||||
async def async_setup_entry(hass, entry, async_add_entities):
|
||||
"""Set up SmartIR Climate from a config entry."""
|
||||
config = {**entry.data, **entry.options}
|
||||
config.pop('platform', None)
|
||||
config.setdefault('unique_id', entry.unique_id)
|
||||
await async_setup_platform(hass, config, async_add_entities)
|
||||
|
||||
|
||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
||||
"""Set up the IR Climate platform."""
|
||||
_LOGGER.debug("Setting up the smartir platform")
|
||||
|
||||
Reference in New Issue
Block a user