diff --git a/homeassistant/components/alexa_devices/binary_sensor.py b/homeassistant/components/alexa_devices/binary_sensor.py index bd7b41c6d5d2..3675500d60f6 100644 --- a/homeassistant/components/alexa_devices/binary_sensor.py +++ b/homeassistant/components/alexa_devices/binary_sensor.py @@ -4,7 +4,7 @@ from collections.abc import Callable from dataclasses import dataclass from typing import Final, override -from aioamazondevices.const.metadata import SENSOR_STATE_OFF +from aioamazondevices.const.sensors import SENSOR_STATE_OFF from aioamazondevices.structures import AmazonDevice from homeassistant.components.binary_sensor import ( diff --git a/homeassistant/components/alexa_devices/manifest.json b/homeassistant/components/alexa_devices/manifest.json index f653fa1623c9..e0a430f839b2 100644 --- a/homeassistant/components/alexa_devices/manifest.json +++ b/homeassistant/components/alexa_devices/manifest.json @@ -8,5 +8,5 @@ "iot_class": "cloud_polling", "loggers": ["aioamazondevices"], "quality_scale": "platinum", - "requirements": ["aioamazondevices==16.3.2"] + "requirements": ["aioamazondevices==16.8.1"] } diff --git a/requirements_all.txt b/requirements_all.txt index 5864c51dc6e6..23a3e5773020 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -190,7 +190,7 @@ aioairzone-cloud==0.7.2 aioairzone==1.0.5 # homeassistant.components.alexa_devices -aioamazondevices==16.3.2 +aioamazondevices==16.8.1 # homeassistant.components.ambient_network # homeassistant.components.ambient_station diff --git a/tests/components/alexa_devices/const.py b/tests/components/alexa_devices/const.py index c312419d7ca2..d0b36c244667 100644 --- a/tests/components/alexa_devices/const.py +++ b/tests/components/alexa_devices/const.py @@ -47,6 +47,9 @@ TEST_DEVICE_1 = AmazonDevice( error_msg=None, error_type=None, scale=None, + feature_name="dnd", + property_name="dnd", + instance="", ), "temperature": AmazonDeviceSensor( name="temperature", @@ -55,6 +58,9 @@ TEST_DEVICE_1 = AmazonDevice( error_msg=None, error_type=None, scale="CELSIUS", + feature_name="temperatureSensor", + property_name="temperature", + instance="1", ), }, notifications_supported=True, @@ -85,6 +91,7 @@ TEST_DEVICE_1 = AmazonDevice( "dropin": "All", }, voice_control_supported=True, + features={}, ) TEST_DEVICE_2_SN = "echo_test_2_serial_number" @@ -113,6 +120,9 @@ TEST_DEVICE_2 = AmazonDevice( error_msg=None, error_type=None, scale="CELSIUS", + feature_name="temperatureSensor", + property_name="temperature", + instance="1", ) }, notifications_supported=False, @@ -120,6 +130,7 @@ TEST_DEVICE_2 = AmazonDevice( media_player_supported=False, communication_settings={}, voice_control_supported=True, + features={}, ) TEST_DEVICE_AQM_SN = "aqm_test_serial_number" @@ -150,6 +161,9 @@ TEST_DEVICE_AQM = AmazonDevice( error_msg=None, error_type=None, scale="%", + feature_name="range", + property_name="rangeValue", + instance="4", ), "VOC": AmazonDeviceSensor( name="VOC", @@ -158,6 +172,9 @@ TEST_DEVICE_AQM = AmazonDevice( error_msg=None, error_type=None, scale=None, + feature_name="range", + property_name="rangeValue", + instance="5", ), "PM25": AmazonDeviceSensor( name="PM25", @@ -166,6 +183,9 @@ TEST_DEVICE_AQM = AmazonDevice( error_msg=None, error_type=None, scale="MicroGramsPerCubicMeter", + feature_name="range", + property_name="rangeValue", + instance="6", ), "PM10": AmazonDeviceSensor( name="PM10", @@ -174,6 +194,9 @@ TEST_DEVICE_AQM = AmazonDevice( error_msg=None, error_type=None, scale="MicroGramsPerCubicMeter", + feature_name="range", + property_name="rangeValue", + instance="7", ), "CO": AmazonDeviceSensor( name="CO", @@ -182,6 +205,9 @@ TEST_DEVICE_AQM = AmazonDevice( error_msg=None, error_type=None, scale="ppm", + feature_name="range", + property_name="rangeValue", + instance="8", ), "Air Quality": AmazonDeviceSensor( name="Air Quality", @@ -190,6 +216,9 @@ TEST_DEVICE_AQM = AmazonDevice( error_msg=None, error_type=None, scale=None, + feature_name="range", + property_name="rangeValue", + instance="9", ), }, notifications_supported=False, @@ -197,6 +226,7 @@ TEST_DEVICE_AQM = AmazonDevice( media_player_supported=False, communication_settings={}, voice_control_supported=False, + features={}, ) TEST_VOCAL_RECORD_INITIAL = AmazonVocalRecord( diff --git a/tests/components/alexa_devices/snapshots/test_diagnostics.ambr b/tests/components/alexa_devices/snapshots/test_diagnostics.ambr index ee115d6e6075..50dc655950a6 100644 --- a/tests/components/alexa_devices/snapshots/test_diagnostics.ambr +++ b/tests/components/alexa_devices/snapshots/test_diagnostics.ambr @@ -18,7 +18,10 @@ 'error': False, 'error_msg': None, 'error_type': None, + 'feature_name': 'dnd', + 'instance': '', 'name': 'dnd', + 'property_name': 'dnd', 'scale': None, 'time_of_sample': None, 'value': False, @@ -27,7 +30,10 @@ 'error': False, 'error_msg': None, 'error_type': None, + 'feature_name': 'temperatureSensor', + 'instance': '1', 'name': 'temperature', + 'property_name': 'temperature', 'scale': 'CELSIUS', 'time_of_sample': None, 'value': '22.5', @@ -59,7 +65,10 @@ 'error': False, 'error_msg': None, 'error_type': None, + 'feature_name': 'dnd', + 'instance': '', 'name': 'dnd', + 'property_name': 'dnd', 'scale': None, 'time_of_sample': None, 'value': False, @@ -68,7 +77,10 @@ 'error': False, 'error_msg': None, 'error_type': None, + 'feature_name': 'temperatureSensor', + 'instance': '1', 'name': 'temperature', + 'property_name': 'temperature', 'scale': 'CELSIUS', 'time_of_sample': None, 'value': '22.5', diff --git a/tests/components/alexa_devices/snapshots/test_services.ambr b/tests/components/alexa_devices/snapshots/test_services.ambr index c677a1acf424..bfd73776cdf4 100644 --- a/tests/components/alexa_devices/snapshots/test_services.ambr +++ b/tests/components/alexa_devices/snapshots/test_services.ambr @@ -22,6 +22,8 @@ 'device_type': 'echo', 'endpoint_id': 'G1234567890123456789012345678A', 'entity_id': '11111111-2222-3333-4444-555555555555', + 'features': dict({ + }), 'hardware_version': '1.0', 'household_device': False, 'manufacturer': 'Test manufacturer', @@ -56,7 +58,10 @@ 'error': False, 'error_msg': None, 'error_type': None, + 'feature_name': 'dnd', + 'instance': '', 'name': 'dnd', + 'property_name': 'dnd', 'scale': None, 'time_of_sample': None, 'value': False, @@ -65,7 +70,10 @@ 'error': False, 'error_msg': None, 'error_type': None, + 'feature_name': 'temperatureSensor', + 'instance': '1', 'name': 'temperature', + 'property_name': 'temperature', 'scale': 'CELSIUS', 'time_of_sample': None, 'value': '22.5', @@ -104,6 +112,8 @@ 'device_type': 'echo', 'endpoint_id': 'G1234567890123456789012345678A', 'entity_id': '11111111-2222-3333-4444-555555555555', + 'features': dict({ + }), 'hardware_version': '1.0', 'household_device': False, 'manufacturer': 'Test manufacturer', @@ -138,7 +148,10 @@ 'error': False, 'error_msg': None, 'error_type': None, + 'feature_name': 'dnd', + 'instance': '', 'name': 'dnd', + 'property_name': 'dnd', 'scale': None, 'time_of_sample': None, 'value': False, @@ -147,7 +160,10 @@ 'error': False, 'error_msg': None, 'error_type': None, + 'feature_name': 'temperatureSensor', + 'instance': '1', 'name': 'temperature', + 'property_name': 'temperature', 'scale': 'CELSIUS', 'time_of_sample': None, 'value': '22.5', @@ -186,6 +202,8 @@ 'device_type': 'echo', 'endpoint_id': 'G1234567890123456789012345678A', 'entity_id': '11111111-2222-3333-4444-555555555555', + 'features': dict({ + }), 'hardware_version': '1.0', 'household_device': False, 'manufacturer': 'Test manufacturer', @@ -220,7 +238,10 @@ 'error': False, 'error_msg': None, 'error_type': None, + 'feature_name': 'dnd', + 'instance': '', 'name': 'dnd', + 'property_name': 'dnd', 'scale': None, 'time_of_sample': None, 'value': False, @@ -229,7 +250,10 @@ 'error': False, 'error_msg': None, 'error_type': None, + 'feature_name': 'temperatureSensor', + 'instance': '1', 'name': 'temperature', + 'property_name': 'temperature', 'scale': 'CELSIUS', 'time_of_sample': None, 'value': '22.5', diff --git a/tests/components/alexa_devices/test_sensor.py b/tests/components/alexa_devices/test_sensor.py index 8171f4ae591d..03607b055a7e 100644 --- a/tests/components/alexa_devices/test_sensor.py +++ b/tests/components/alexa_devices/test_sensor.py @@ -178,6 +178,9 @@ async def test_unit_of_measurement( error_msg=None, error_type=None, scale=scale, + feature_name="sensor", + property_name="sensor", + instance="1", ) } @@ -208,6 +211,9 @@ async def test_sensor_unavailable( error_msg=None, error_type=None, scale=None, + feature_name="lightSensor", + property_name="illuminance", + instance="1", ) }