mirror of
https://github.com/home-assistant/core.git
synced 2025-09-05 12:51:37 +02:00
Add support for fineDustSensor capability in SmartThings (#150714)
This commit is contained in:
committed by
GitHub
parent
7f16b11776
commit
1aa3efaf8a
@@ -476,6 +476,16 @@ CAPABILITY_TO_SENSORS: dict[
|
||||
)
|
||||
]
|
||||
},
|
||||
Capability.FINE_DUST_SENSOR: {
|
||||
Attribute.FINE_DUST_LEVEL: [
|
||||
SmartThingsSensorEntityDescription(
|
||||
key=Attribute.FINE_DUST_LEVEL,
|
||||
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
device_class=SensorDeviceClass.PM25,
|
||||
)
|
||||
]
|
||||
},
|
||||
# Haven't seen at devices yet
|
||||
Capability.FORMALDEHYDE_MEASUREMENT: {
|
||||
Attribute.FORMALDEHYDE_LEVEL: [
|
||||
|
@@ -96,6 +96,7 @@ def mock_smartthings() -> Generator[AsyncMock]:
|
||||
|
||||
@pytest.fixture(
|
||||
params=[
|
||||
"aq_sensor_3_ikea",
|
||||
"da_ac_airsensor_01001",
|
||||
"da_ac_rac_000001",
|
||||
"da_ac_rac_000003",
|
||||
|
@@ -0,0 +1,94 @@
|
||||
{
|
||||
"components": {
|
||||
"main": {
|
||||
"tvocMeasurement": {
|
||||
"tvocLevel": {
|
||||
"value": 0.1,
|
||||
"unit": "ppm",
|
||||
"timestamp": "2025-08-15T13:48:52.222Z"
|
||||
}
|
||||
},
|
||||
"fineDustSensor": {
|
||||
"fineDustLevel": {
|
||||
"value": 1,
|
||||
"unit": "\u03bcg/m^3",
|
||||
"timestamp": "2025-08-15T13:29:36.938Z"
|
||||
}
|
||||
},
|
||||
"relativeHumidityMeasurement": {
|
||||
"humidity": {
|
||||
"value": 53.0,
|
||||
"unit": "%",
|
||||
"timestamp": "2025-08-15T13:48:42.554Z"
|
||||
}
|
||||
},
|
||||
"temperatureMeasurement": {
|
||||
"temperatureRange": {
|
||||
"value": {
|
||||
"minimum": -10.0,
|
||||
"maximum": 50.0
|
||||
},
|
||||
"unit": "C",
|
||||
"timestamp": "2025-03-19T19:48:47.896Z"
|
||||
},
|
||||
"temperature": {
|
||||
"value": 22.0,
|
||||
"unit": "C",
|
||||
"timestamp": "2025-08-15T12:25:37.127Z"
|
||||
}
|
||||
},
|
||||
"refresh": {},
|
||||
"airQualityHealthConcern": {
|
||||
"supportedAirQualityValues": {
|
||||
"value": null
|
||||
},
|
||||
"airQualityHealthConcern": {
|
||||
"value": "good",
|
||||
"timestamp": "2025-08-15T13:17:38.791Z"
|
||||
}
|
||||
},
|
||||
"firmwareUpdate": {
|
||||
"lastUpdateStatusReason": {
|
||||
"value": "TOO_MANY_CLIENTS",
|
||||
"timestamp": "2025-06-09T05:59:52.076Z"
|
||||
},
|
||||
"imageTransferProgress": {
|
||||
"value": null
|
||||
},
|
||||
"availableVersion": {
|
||||
"value": "00010010",
|
||||
"timestamp": "2025-03-19T19:49:07.016Z"
|
||||
},
|
||||
"lastUpdateStatus": {
|
||||
"value": "updateFailed",
|
||||
"timestamp": "2025-06-09T05:59:52.072Z"
|
||||
},
|
||||
"supportedCommands": {
|
||||
"value": null
|
||||
},
|
||||
"state": {
|
||||
"value": "normalOperation",
|
||||
"timestamp": "2025-06-09T05:59:52.105Z"
|
||||
},
|
||||
"estimatedTimeRemaining": {
|
||||
"value": null
|
||||
},
|
||||
"updateAvailable": {
|
||||
"value": false,
|
||||
"timestamp": "2025-03-19T19:49:07.014Z"
|
||||
},
|
||||
"currentVersion": {
|
||||
"value": "00010010",
|
||||
"timestamp": "2025-06-09T05:59:52.071Z"
|
||||
},
|
||||
"lastUpdateTime": {
|
||||
"value": "2025-06-09T05:59:51Z",
|
||||
"timestamp": "2025-06-09T05:59:52.076Z"
|
||||
},
|
||||
"supportsProgressReports": {
|
||||
"value": null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"items": [
|
||||
{
|
||||
"deviceId": "e44d4e5c-45ea-498f-a653-f5d0c3d97bb8",
|
||||
"name": "humidity-temp-dust-tvoc",
|
||||
"label": "aq-sensor-3-ikea",
|
||||
"manufacturerName": "SmartThingsCommunity",
|
||||
"presentationId": "a39f5e57-c861-3904-9567-acda80b7cf2d",
|
||||
"deviceManufacturerCode": "IKEA of Sweden",
|
||||
"locationId": "9fbc89a0-5c32-494d-9a49-68186d6a5387",
|
||||
"ownerId": "d051c4c5-8ccb-47b9-87ee-7ebb99694b9f",
|
||||
"roomId": "f5ce3177-e0a6-4415-8496-bafa1611ee62",
|
||||
"components": [
|
||||
{
|
||||
"id": "main",
|
||||
"label": "main",
|
||||
"capabilities": [
|
||||
{
|
||||
"id": "temperatureMeasurement",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "relativeHumidityMeasurement",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "fineDustSensor",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "airQualityHealthConcern",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "tvocMeasurement",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "firmwareUpdate",
|
||||
"version": 1
|
||||
},
|
||||
{
|
||||
"id": "refresh",
|
||||
"version": 1
|
||||
}
|
||||
],
|
||||
"categories": [
|
||||
{
|
||||
"name": "AirQualityDetector",
|
||||
"categoryType": "manufacturer"
|
||||
}
|
||||
],
|
||||
"optional": false
|
||||
}
|
||||
],
|
||||
"createTime": "2025-03-19T19:48:39.571Z",
|
||||
"parentDeviceId": "5616f552-5bae-4a1f-94b3-9eb2673a1b28",
|
||||
"profile": {
|
||||
"id": "0720a973-6923-39d4-8991-3aaed6edf5d5"
|
||||
},
|
||||
"zigbee": {
|
||||
"eui": "0CAE5FFFFECE4328",
|
||||
"networkId": "846B",
|
||||
"driverId": "9bee78b3-204e-4118-8265-8767f9152c49",
|
||||
"executingLocally": true,
|
||||
"hubId": "5616f552-5bae-4a1f-94b3-9eb2673a1b28",
|
||||
"provisioningState": "PROVISIONED"
|
||||
},
|
||||
"type": "ZIGBEE",
|
||||
"restrictionTier": 0,
|
||||
"allowed": null,
|
||||
"executionContext": "LOCAL",
|
||||
"relationships": []
|
||||
}
|
||||
],
|
||||
"_links": {}
|
||||
}
|
@@ -64,6 +64,37 @@
|
||||
'via_device_id': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_devices[aq_sensor_3_ikea]
|
||||
DeviceRegistryEntrySnapshot({
|
||||
'area_id': None,
|
||||
'config_entries': <ANY>,
|
||||
'config_entries_subentries': <ANY>,
|
||||
'configuration_url': 'https://account.smartthings.com',
|
||||
'connections': set({
|
||||
}),
|
||||
'disabled_by': None,
|
||||
'entry_type': None,
|
||||
'hw_version': None,
|
||||
'id': <ANY>,
|
||||
'identifiers': set({
|
||||
tuple(
|
||||
'smartthings',
|
||||
'e44d4e5c-45ea-498f-a653-f5d0c3d97bb8',
|
||||
),
|
||||
}),
|
||||
'labels': set({
|
||||
}),
|
||||
'manufacturer': None,
|
||||
'model': None,
|
||||
'model_id': None,
|
||||
'name': 'aq-sensor-3-ikea',
|
||||
'name_by_user': None,
|
||||
'primary_config_entry': <ANY>,
|
||||
'serial_number': None,
|
||||
'sw_version': None,
|
||||
'via_device_id': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_devices[aux_ac]
|
||||
DeviceRegistryEntrySnapshot({
|
||||
'area_id': None,
|
||||
|
@@ -163,6 +163,221 @@
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[aq_sensor_3_ikea][sensor.aq_sensor_3_ikea_humidity-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.aq_sensor_3_ikea_humidity',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.HUMIDITY: 'humidity'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Humidity',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': 'e44d4e5c-45ea-498f-a653-f5d0c3d97bb8_main_relativeHumidityMeasurement_humidity_humidity',
|
||||
'unit_of_measurement': '%',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[aq_sensor_3_ikea][sensor.aq_sensor_3_ikea_humidity-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'humidity',
|
||||
'friendly_name': 'aq-sensor-3-ikea Humidity',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': '%',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.aq_sensor_3_ikea_humidity',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '53.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[aq_sensor_3_ikea][sensor.aq_sensor_3_ikea_pm2_5-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.aq_sensor_3_ikea_pm2_5',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.PM25: 'pm25'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'PM2.5',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': 'e44d4e5c-45ea-498f-a653-f5d0c3d97bb8_main_fineDustSensor_fineDustLevel_fineDustLevel',
|
||||
'unit_of_measurement': 'µg/m³',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[aq_sensor_3_ikea][sensor.aq_sensor_3_ikea_pm2_5-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'pm25',
|
||||
'friendly_name': 'aq-sensor-3-ikea PM2.5',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'µg/m³',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.aq_sensor_3_ikea_pm2_5',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '1',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[aq_sensor_3_ikea][sensor.aq_sensor_3_ikea_temperature-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.aq_sensor_3_ikea_temperature',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
'sensor': dict({
|
||||
'suggested_display_precision': 1,
|
||||
}),
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.TEMPERATURE: 'temperature'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Temperature',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': 'e44d4e5c-45ea-498f-a653-f5d0c3d97bb8_main_temperatureMeasurement_temperature_temperature',
|
||||
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[aq_sensor_3_ikea][sensor.aq_sensor_3_ikea_temperature-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'temperature',
|
||||
'friendly_name': 'aq-sensor-3-ikea Temperature',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.aq_sensor_3_ikea_temperature',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '22.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[aq_sensor_3_ikea][sensor.aq_sensor_3_ikea_volatile_organic_compounds_parts-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.aq_sensor_3_ikea_volatile_organic_compounds_parts',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS_PARTS: 'volatile_organic_compounds_parts'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Volatile organic compounds parts',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': 'e44d4e5c-45ea-498f-a653-f5d0c3d97bb8_main_tvocMeasurement_tvocLevel_tvocLevel',
|
||||
'unit_of_measurement': 'ppm',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[aq_sensor_3_ikea][sensor.aq_sensor_3_ikea_volatile_organic_compounds_parts-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'volatile_organic_compounds_parts',
|
||||
'friendly_name': 'aq-sensor-3-ikea Volatile organic compounds parts',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'ppm',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.aq_sensor_3_ikea_volatile_organic_compounds_parts',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '0.1',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[aux_ac][sensor.aux_a_c_on_off_temperature-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@@ -1,4 +1,65 @@
|
||||
# serializer version: 1
|
||||
# name: test_all_entities[aq_sensor_3_ikea][update.aq_sensor_3_ikea_firmware-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'update',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'update.aq_sensor_3_ikea_firmware',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <UpdateDeviceClass.FIRMWARE: 'firmware'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Firmware',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': <UpdateEntityFeature: 5>,
|
||||
'translation_key': None,
|
||||
'unique_id': 'e44d4e5c-45ea-498f-a653-f5d0c3d97bb8_main',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[aq_sensor_3_ikea][update.aq_sensor_3_ikea_firmware-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'auto_update': False,
|
||||
'device_class': 'firmware',
|
||||
'display_precision': 0,
|
||||
'entity_picture': 'https://brands.home-assistant.io/_/smartthings/icon.png',
|
||||
'friendly_name': 'aq-sensor-3-ikea Firmware',
|
||||
'in_progress': False,
|
||||
'installed_version': '00010010',
|
||||
'latest_version': '00010010',
|
||||
'release_summary': None,
|
||||
'release_url': None,
|
||||
'skipped_version': None,
|
||||
'supported_features': <UpdateEntityFeature: 5>,
|
||||
'title': None,
|
||||
'update_percentage': None,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'update.aq_sensor_3_ikea_firmware',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[bosch_radiator_thermostat_ii][update.radiator_thermostat_ii_m_wohnzimmer_firmware-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
Reference in New Issue
Block a user