diff --git a/homeassistant/components/homewizard/manifest.json b/homeassistant/components/homewizard/manifest.json index ab3f4706970..949dda2a8aa 100644 --- a/homeassistant/components/homewizard/manifest.json +++ b/homeassistant/components/homewizard/manifest.json @@ -7,6 +7,6 @@ "iot_class": "local_polling", "loggers": ["homewizard_energy"], "quality_scale": "platinum", - "requirements": ["python-homewizard-energy==4.0.0"], + "requirements": ["python-homewizard-energy==4.1.0"], "zeroconf": ["_hwenergy._tcp.local."] } diff --git a/requirements_all.txt b/requirements_all.txt index 03a12b59131..582d006da86 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -2143,7 +2143,7 @@ python-gc100==1.0.3a0 python-gitlab==1.6.0 # homeassistant.components.homewizard -python-homewizard-energy==4.0.0 +python-homewizard-energy==4.1.0 # homeassistant.components.hp_ilo python-hpilo==4.3 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 538ec4e2e9f..7fed131510e 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -1600,7 +1600,7 @@ python-ecobee-api==0.2.17 python-fullykiosk==0.0.12 # homeassistant.components.homewizard -python-homewizard-energy==4.0.0 +python-homewizard-energy==4.1.0 # homeassistant.components.izone python-izone==1.2.9 diff --git a/tests/components/homewizard/snapshots/test_diagnostics.ambr b/tests/components/homewizard/snapshots/test_diagnostics.ambr index 8632f1ec008..4fea0c3249e 100644 --- a/tests/components/homewizard/snapshots/test_diagnostics.ambr +++ b/tests/components/homewizard/snapshots/test_diagnostics.ambr @@ -265,7 +265,9 @@ 'serial': '**REDACTED**', }), 'state': None, - 'system': None, + 'system': dict({ + 'cloud_enabled': True, + }), }), 'entry': dict({ 'ip_address': '**REDACTED**', @@ -332,7 +334,9 @@ 'serial': '**REDACTED**', }), 'state': None, - 'system': None, + 'system': dict({ + 'cloud_enabled': True, + }), }), 'entry': dict({ 'ip_address': '**REDACTED**', diff --git a/tests/components/homewizard/snapshots/test_switch.ambr b/tests/components/homewizard/snapshots/test_switch.ambr index d38fab029d3..0fb4680a0b1 100644 --- a/tests/components/homewizard/snapshots/test_switch.ambr +++ b/tests/components/homewizard/snapshots/test_switch.ambr @@ -1,5 +1,5 @@ # serializer version: 1 -# name: test_switch_entities[switch.device-state_set-power_on-HWE-SKT] +# name: test_switch_entities[HWE-SKT-switch.device-state_set-power_on] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'outlet', @@ -12,7 +12,7 @@ 'state': 'on', }) # --- -# name: test_switch_entities[switch.device-state_set-power_on-HWE-SKT].1 +# name: test_switch_entities[HWE-SKT-switch.device-state_set-power_on].1 EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -43,7 +43,7 @@ 'unit_of_measurement': None, }) # --- -# name: test_switch_entities[switch.device-state_set-power_on-HWE-SKT].2 +# name: test_switch_entities[HWE-SKT-switch.device-state_set-power_on].2 DeviceRegistryEntrySnapshot({ 'area_id': None, 'config_entries': , @@ -75,7 +75,7 @@ 'via_device_id': None, }) # --- -# name: test_switch_entities[switch.device_cloud_connection-system_set-cloud_enabled-HWE-SKT] +# name: test_switch_entities[HWE-SKT-switch.device_cloud_connection-system_set-cloud_enabled] StateSnapshot({ 'attributes': ReadOnlyDict({ 'friendly_name': 'Device Cloud connection', @@ -88,7 +88,7 @@ 'state': 'on', }) # --- -# name: test_switch_entities[switch.device_cloud_connection-system_set-cloud_enabled-HWE-SKT].1 +# name: test_switch_entities[HWE-SKT-switch.device_cloud_connection-system_set-cloud_enabled].1 EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -119,7 +119,7 @@ 'unit_of_measurement': None, }) # --- -# name: test_switch_entities[switch.device_cloud_connection-system_set-cloud_enabled-HWE-SKT].2 +# name: test_switch_entities[HWE-SKT-switch.device_cloud_connection-system_set-cloud_enabled].2 DeviceRegistryEntrySnapshot({ 'area_id': None, 'config_entries': , @@ -151,7 +151,7 @@ 'via_device_id': None, }) # --- -# name: test_switch_entities[switch.device_switch_lock-state_set-switch_lock-HWE-SKT] +# name: test_switch_entities[HWE-SKT-switch.device_switch_lock-state_set-switch_lock] StateSnapshot({ 'attributes': ReadOnlyDict({ 'friendly_name': 'Device Switch lock', @@ -164,7 +164,7 @@ 'state': 'off', }) # --- -# name: test_switch_entities[switch.device_switch_lock-state_set-switch_lock-HWE-SKT].1 +# name: test_switch_entities[HWE-SKT-switch.device_switch_lock-state_set-switch_lock].1 EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -195,7 +195,7 @@ 'unit_of_measurement': None, }) # --- -# name: test_switch_entities[switch.device_switch_lock-state_set-switch_lock-HWE-SKT].2 +# name: test_switch_entities[HWE-SKT-switch.device_switch_lock-state_set-switch_lock].2 DeviceRegistryEntrySnapshot({ 'area_id': None, 'config_entries': , @@ -227,3 +227,155 @@ 'via_device_id': None, }) # --- +# name: test_switch_entities[SDM230-switch.device_cloud_connection-system_set-cloud_enabled] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Device Cloud connection', + 'icon': 'mdi:cloud', + }), + 'context': , + 'entity_id': 'switch.device_cloud_connection', + 'last_changed': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_switch_entities[SDM230-switch.device_cloud_connection-system_set-cloud_enabled].1 + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.device_cloud_connection', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cloud', + 'original_name': 'Cloud connection', + 'platform': 'homewizard', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'cloud_connection', + 'unique_id': 'aabbccddeeff_cloud_connection', + 'unit_of_measurement': None, + }) +# --- +# name: test_switch_entities[SDM230-switch.device_cloud_connection-system_set-cloud_enabled].2 + DeviceRegistryEntrySnapshot({ + 'area_id': None, + 'config_entries': , + 'configuration_url': None, + 'connections': set({ + tuple( + 'mac', + '3c:39:e7:aa:bb:cc', + ), + }), + 'disabled_by': None, + 'entry_type': None, + 'hw_version': None, + 'id': , + 'identifiers': set({ + tuple( + 'homewizard', + '3c39e7aabbcc', + ), + }), + 'is_new': False, + 'manufacturer': 'HomeWizard', + 'model': 'SDM230-wifi', + 'name': 'Device', + 'name_by_user': None, + 'serial_number': None, + 'suggested_area': None, + 'sw_version': '3.06', + 'via_device_id': None, + }) +# --- +# name: test_switch_entities[SDM630-switch.device_cloud_connection-system_set-cloud_enabled] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Device Cloud connection', + 'icon': 'mdi:cloud', + }), + 'context': , + 'entity_id': 'switch.device_cloud_connection', + 'last_changed': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_switch_entities[SDM630-switch.device_cloud_connection-system_set-cloud_enabled].1 + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.device_cloud_connection', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cloud', + 'original_name': 'Cloud connection', + 'platform': 'homewizard', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'cloud_connection', + 'unique_id': 'aabbccddeeff_cloud_connection', + 'unit_of_measurement': None, + }) +# --- +# name: test_switch_entities[SDM630-switch.device_cloud_connection-system_set-cloud_enabled].2 + DeviceRegistryEntrySnapshot({ + 'area_id': None, + 'config_entries': , + 'configuration_url': None, + 'connections': set({ + tuple( + 'mac', + '3c:39:e7:aa:bb:cc', + ), + }), + 'disabled_by': None, + 'entry_type': None, + 'hw_version': None, + 'id': , + 'identifiers': set({ + tuple( + 'homewizard', + '3c39e7aabbcc', + ), + }), + 'is_new': False, + 'manufacturer': 'HomeWizard', + 'model': 'SDM630-wifi', + 'name': 'Device', + 'name_by_user': None, + 'serial_number': None, + 'suggested_area': None, + 'sw_version': '3.06', + 'via_device_id': None, + }) +# --- diff --git a/tests/components/homewizard/test_switch.py b/tests/components/homewizard/test_switch.py index 0bb95a3a244..0b88f1ca949 100644 --- a/tests/components/homewizard/test_switch.py +++ b/tests/components/homewizard/test_switch.py @@ -42,7 +42,6 @@ pytestmark = [ [ "switch.device", "switch.device_switch_lock", - "switch.device_cloud_connection", ], ), ( @@ -50,7 +49,6 @@ pytestmark = [ [ "switch.device", "switch.device_switch_lock", - "switch.device_cloud_connection", ], ), ], @@ -64,13 +62,14 @@ async def test_entities_not_created_for_device( assert not hass.states.get(entity_id) -@pytest.mark.parametrize("device_fixture", ["HWE-SKT"]) @pytest.mark.parametrize( - ("entity_id", "method", "parameter"), + ("device_fixture", "entity_id", "method", "parameter"), [ - ("switch.device", "state_set", "power_on"), - ("switch.device_switch_lock", "state_set", "switch_lock"), - ("switch.device_cloud_connection", "system_set", "cloud_enabled"), + ("HWE-SKT", "switch.device", "state_set", "power_on"), + ("HWE-SKT", "switch.device_switch_lock", "state_set", "switch_lock"), + ("HWE-SKT", "switch.device_cloud_connection", "system_set", "cloud_enabled"), + ("SDM230", "switch.device_cloud_connection", "system_set", "cloud_enabled"), + ("SDM630", "switch.device_cloud_connection", "system_set", "cloud_enabled"), ], ) async def test_switch_entities(