Implement config and option flow for rfxtrx integration (#39117)
* Create option flow for Rfxtrx integration (#37982) * Implement config flow for rfxtrx integration (#39299) * Add config flow * Add strings * Add first series of tests * Add tests * Adjust tests according review comments * Adjust strings * Add executor for testing connection * Change ports to dict * Fix pylint issue * Adjust tests * Migrate config entry for rfxtrx integration (#39528) * Add rfxtrx device connection validation when importing (#39582) * Implement import connection validation * Fix binary sensor tests * Move rfxtrx data * Fix cover tests * Fix test init * Fix light tests * Fix sensor tests * Fix switch tests * Refactor rfxtrx test data * Fix strings * Fix check * Rework device string in test code * Add option to delete multiple rfxtrx devices (#39625) * Opt to remove multiple devices * Fix devices key * Add tests (phase 1) * Add tests (phase 2) * Tweak remove devices test * Implement device migration function in rfxtrx option flow (#39694) * Prompt option to replace device * Revert unwanted changes * Add replace device function * WIP replace entities * Remove device/entities and update config entry * Fix styling * Add info * Add test * Fix strings * Refactor building migration map * Allow migration for all device types * Add test to migrate control device * Fixup some names * Fixup entry names in test code * Bump pyRFXtrx to 0.26 and deprecate debug config key (#40679) * Create option flow for Rfxtrx integration (#37982) * Implement config flow for rfxtrx integration (#39299) * Add config flow * Add strings * Add first series of tests * Add tests * Adjust tests according review comments * Adjust strings * Add executor for testing connection * Change ports to dict * Fix pylint issue * Adjust tests * Migrate config entry for rfxtrx integration (#39528) * Add rfxtrx device connection validation when importing (#39582) * Implement import connection validation * Fix binary sensor tests * Move rfxtrx data * Fix cover tests * Fix test init * Fix light tests * Fix sensor tests * Fix switch tests * Refactor rfxtrx test data * Fix strings * Fix check * Rework device string in test code * Add option to delete multiple rfxtrx devices (#39625) * Opt to remove multiple devices * Fix devices key * Add tests (phase 1) * Add tests (phase 2) * Tweak remove devices test * Implement device migration function in rfxtrx option flow (#39694) * Prompt option to replace device * Revert unwanted changes * Add replace device function * WIP replace entities * Remove device/entities and update config entry * Fix styling * Add info * Add test * Fix strings * Refactor building migration map * Allow migration for all device types * Add test to migrate control device * Fixup some names * Fixup entry names in test code * Bump version number * Remove debug key from connect * Remove debug option from config flow * Remove debug from tests * Fix event test * Add cv.deprecated * Fix test * Fix config schema * Add timeout on connection * Rework config schema * Fix schema...again * Prevent creation of duplicate device in rfxtrx option flow (#40656)
This commit is contained in:
1 parent
44e5ec58b0
commit
c5041b41c8
22 files changed
+2202
-363
No files matched your search
@@ -25,6 +25,16 @@ DATA_SWITCH = f"{DOMAIN}_switch"
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def supported(event):
|
||||
"""Return whether an event supports switch."""
|
||||
return (
|
||||
isinstance(event.device, rfxtrxmod.LightingDevice)
|
||||
and not event.device.known_to_be_dimmable
|
||||
and not event.device.known_to_be_rollershutter
|
||||
or isinstance(event.device, rfxtrxmod.RfyDevice)
|
||||
)
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass,
|
||||
config_entry,
|
||||
@@ -34,14 +44,6 @@ async def async_setup_entry(
|
||||
discovery_info = config_entry.data
|
||||
device_ids = set()
|
||||
|
||||
def supported(event):
|
||||
return (
|
||||
isinstance(event.device, rfxtrxmod.LightingDevice)
|
||||
and not event.device.known_to_be_dimmable
|
||||
and not event.device.known_to_be_rollershutter
|
||||
or isinstance(event.device, rfxtrxmod.RfyDevice)
|
||||
)
|
||||
|
||||
# Add switch from config file
|
||||
entities = []
|
||||
for packet_id, entity_info in discovery_info[CONF_DEVICES].items():
|
||||
|
||||
Reference in new issue
Block a user