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
@@ -61,6 +61,18 @@ DEVICE_TYPE_DEVICE_CLASS = {
|
||||
}
|
||||
|
||||
|
||||
def supported(event):
|
||||
"""Return whether an event supports binary_sensor."""
|
||||
if isinstance(event, rfxtrxmod.ControlEvent):
|
||||
return True
|
||||
if isinstance(event, rfxtrxmod.SensorEvent):
|
||||
return event.values.get("Sensor Status") in [
|
||||
*SENSOR_STATUS_ON,
|
||||
*SENSOR_STATUS_OFF,
|
||||
]
|
||||
return False
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass,
|
||||
config_entry,
|
||||
@@ -74,16 +86,6 @@ async def async_setup_entry(
|
||||
|
||||
discovery_info = config_entry.data
|
||||
|
||||
def supported(event):
|
||||
if isinstance(event, rfxtrxmod.ControlEvent):
|
||||
return True
|
||||
if isinstance(event, rfxtrxmod.SensorEvent):
|
||||
return event.values.get("Sensor Status") in [
|
||||
*SENSOR_STATUS_ON,
|
||||
*SENSOR_STATUS_OFF,
|
||||
]
|
||||
return False
|
||||
|
||||
for packet_id, entity_info in discovery_info[CONF_DEVICES].items():
|
||||
event = get_rfx_object(packet_id)
|
||||
if event is None:
|
||||
|
||||
Reference in new issue
Block a user