mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 12:08:19 +00:00
Fix Tuya fan speeds with numeric values (#149971)
This commit is contained in:
parent
20fdec9e9c
commit
3a64357201
@ -267,7 +267,9 @@ class TuyaFanEntity(TuyaEntity, FanEntity):
|
|||||||
return int(self._speed.remap_value_to(value, 1, 100))
|
return int(self._speed.remap_value_to(value, 1, 100))
|
||||||
|
|
||||||
if self._speeds is not None:
|
if self._speeds is not None:
|
||||||
if (value := self.device.status.get(self._speeds.dpcode)) is None:
|
if (
|
||||||
|
value := self.device.status.get(self._speeds.dpcode)
|
||||||
|
) is None or value not in self._speeds.range:
|
||||||
return None
|
return None
|
||||||
return ordered_list_item_to_percentage(self._speeds.range, value)
|
return ordered_list_item_to_percentage(self._speeds.range, value)
|
||||||
|
|
||||||
|
@ -41,6 +41,11 @@ DEVICE_MOCKS = {
|
|||||||
Platform.SENSOR,
|
Platform.SENSOR,
|
||||||
Platform.SWITCH,
|
Platform.SWITCH,
|
||||||
],
|
],
|
||||||
|
"cs_qhxmvae667uap4zh": [
|
||||||
|
# https://github.com/home-assistant/core/issues/141278
|
||||||
|
Platform.FAN,
|
||||||
|
Platform.HUMIDIFIER,
|
||||||
|
],
|
||||||
"cs_vmxuxszzjwp5smli": [
|
"cs_vmxuxszzjwp5smli": [
|
||||||
# https://github.com/home-assistant/core/issues/119865
|
# https://github.com/home-assistant/core/issues/119865
|
||||||
Platform.FAN,
|
Platform.FAN,
|
||||||
@ -214,6 +219,16 @@ DEVICE_MOCKS = {
|
|||||||
# https://github.com/home-assistant/core/issues/143499
|
# https://github.com/home-assistant/core/issues/143499
|
||||||
Platform.SENSOR,
|
Platform.SENSOR,
|
||||||
],
|
],
|
||||||
|
"fs_g0ewlb1vmwqljzji": [
|
||||||
|
# https://github.com/home-assistant/core/issues/141231
|
||||||
|
Platform.FAN,
|
||||||
|
Platform.LIGHT,
|
||||||
|
Platform.SELECT,
|
||||||
|
],
|
||||||
|
"fs_ibytpo6fpnugft1c": [
|
||||||
|
# https://github.com/home-assistant/core/issues/135541
|
||||||
|
Platform.FAN,
|
||||||
|
],
|
||||||
"gyd_lgekqfxdabipm3tn": [
|
"gyd_lgekqfxdabipm3tn": [
|
||||||
# https://github.com/home-assistant/core/issues/133173
|
# https://github.com/home-assistant/core/issues/133173
|
||||||
Platform.LIGHT,
|
Platform.LIGHT,
|
||||||
@ -227,6 +242,11 @@ DEVICE_MOCKS = {
|
|||||||
# https://github.com/home-assistant/core/issues/148347
|
# https://github.com/home-assistant/core/issues/148347
|
||||||
Platform.SWITCH,
|
Platform.SWITCH,
|
||||||
],
|
],
|
||||||
|
"kj_CAjWAxBUZt7QZHfz": [
|
||||||
|
# https://github.com/home-assistant/core/issues/146023
|
||||||
|
Platform.FAN,
|
||||||
|
Platform.SWITCH,
|
||||||
|
],
|
||||||
"kj_yrzylxax1qspdgpp": [
|
"kj_yrzylxax1qspdgpp": [
|
||||||
# https://github.com/orgs/home-assistant/discussions/61
|
# https://github.com/orgs/home-assistant/discussions/61
|
||||||
Platform.FAN,
|
Platform.FAN,
|
||||||
|
32
tests/components/tuya/fixtures/cs_qhxmvae667uap4zh.json
Normal file
32
tests/components/tuya/fixtures/cs_qhxmvae667uap4zh.json
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"endpoint": "https://apigw.tuyaeu.com",
|
||||||
|
"terminal_id": "REDACTED",
|
||||||
|
"mqtt_connected": true,
|
||||||
|
"disabled_by": null,
|
||||||
|
"disabled_polling": false,
|
||||||
|
"id": "28403630e8db84b7a963",
|
||||||
|
"name": "DryFix",
|
||||||
|
"category": "cs",
|
||||||
|
"product_id": "qhxmvae667uap4zh",
|
||||||
|
"product_name": "",
|
||||||
|
"online": false,
|
||||||
|
"sub": false,
|
||||||
|
"time_zone": "+01:00",
|
||||||
|
"active_time": "2024-04-03T13:10:02+00:00",
|
||||||
|
"create_time": "2024-04-03T13:10:02+00:00",
|
||||||
|
"update_time": "2024-04-03T13:10:02+00:00",
|
||||||
|
"function": {},
|
||||||
|
"status_range": {
|
||||||
|
"fault": {
|
||||||
|
"type": "Bitmap",
|
||||||
|
"value": {
|
||||||
|
"label": ["E1", "E2"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"fault": 0
|
||||||
|
},
|
||||||
|
"set_up": true,
|
||||||
|
"support_local": true
|
||||||
|
}
|
134
tests/components/tuya/fixtures/fs_g0ewlb1vmwqljzji.json
Normal file
134
tests/components/tuya/fixtures/fs_g0ewlb1vmwqljzji.json
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
{
|
||||||
|
"endpoint": "https://apigw.tuyaeu.com",
|
||||||
|
"terminal_id": "REDACTED",
|
||||||
|
"mqtt_connected": true,
|
||||||
|
"disabled_by": null,
|
||||||
|
"disabled_polling": false,
|
||||||
|
"id": "XXX",
|
||||||
|
"name": "Ceiling Fan With Light",
|
||||||
|
"category": "fs",
|
||||||
|
"product_id": "g0ewlb1vmwqljzji",
|
||||||
|
"product_name": "Ceiling Fan With Light",
|
||||||
|
"online": true,
|
||||||
|
"sub": false,
|
||||||
|
"time_zone": "+01:00",
|
||||||
|
"active_time": "2025-03-22T22:57:04+00:00",
|
||||||
|
"create_time": "2025-03-22T22:57:04+00:00",
|
||||||
|
"update_time": "2025-03-22T22:57:04+00:00",
|
||||||
|
"function": {
|
||||||
|
"switch": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"mode": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["normal", "sleep", "nature"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fan_speed": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["1", "2", "3", "4", "5", "6"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fan_direction": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["forward", "reverse"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"light": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"bright_value": {
|
||||||
|
"type": "Integer",
|
||||||
|
"value": {
|
||||||
|
"min": 0,
|
||||||
|
"max": 100,
|
||||||
|
"scale": 0,
|
||||||
|
"step": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"temp_value": {
|
||||||
|
"type": "Integer",
|
||||||
|
"value": {
|
||||||
|
"min": 0,
|
||||||
|
"max": 100,
|
||||||
|
"scale": 0,
|
||||||
|
"step": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"countdown_set": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["cancel", "1h", "2h", "4h", "8h"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"status_range": {
|
||||||
|
"switch": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"mode": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["normal", "sleep", "nature"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fan_speed": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["1", "2", "3", "4", "5", "6"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fan_direction": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["forward", "reverse"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"light": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"bright_value": {
|
||||||
|
"type": "Integer",
|
||||||
|
"value": {
|
||||||
|
"min": 0,
|
||||||
|
"max": 100,
|
||||||
|
"scale": 0,
|
||||||
|
"step": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"temp_value": {
|
||||||
|
"type": "Integer",
|
||||||
|
"value": {
|
||||||
|
"min": 0,
|
||||||
|
"max": 100,
|
||||||
|
"scale": 0,
|
||||||
|
"step": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"countdown_set": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["cancel", "1h", "2h", "4h", "8h"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"switch": true,
|
||||||
|
"mode": "normal",
|
||||||
|
"fan_speed": 1,
|
||||||
|
"fan_direction": "reverse",
|
||||||
|
"light": true,
|
||||||
|
"bright_value": 100,
|
||||||
|
"temp_value": 0,
|
||||||
|
"countdown_set": "off"
|
||||||
|
},
|
||||||
|
"set_up": true,
|
||||||
|
"support_local": true
|
||||||
|
}
|
23
tests/components/tuya/fixtures/fs_ibytpo6fpnugft1c.json
Normal file
23
tests/components/tuya/fixtures/fs_ibytpo6fpnugft1c.json
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"endpoint": "https://apigw.tuyaeu.com",
|
||||||
|
"terminal_id": "REDACTED",
|
||||||
|
"mqtt_connected": true,
|
||||||
|
"disabled_by": null,
|
||||||
|
"disabled_polling": false,
|
||||||
|
"id": "10706550a4e57c88b93a",
|
||||||
|
"name": "Ventilador Cama",
|
||||||
|
"category": "fs",
|
||||||
|
"product_id": "ibytpo6fpnugft1c",
|
||||||
|
"product_name": "Tower bladeless fan ",
|
||||||
|
"online": true,
|
||||||
|
"sub": false,
|
||||||
|
"time_zone": "+01:00",
|
||||||
|
"active_time": "2025-01-10T18:47:46+00:00",
|
||||||
|
"create_time": "2025-01-10T18:47:46+00:00",
|
||||||
|
"update_time": "2025-01-10T18:47:46+00:00",
|
||||||
|
"function": {},
|
||||||
|
"status_range": {},
|
||||||
|
"status": {},
|
||||||
|
"set_up": true,
|
||||||
|
"support_local": true
|
||||||
|
}
|
86
tests/components/tuya/fixtures/kj_CAjWAxBUZt7QZHfz.json
Normal file
86
tests/components/tuya/fixtures/kj_CAjWAxBUZt7QZHfz.json
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
{
|
||||||
|
"endpoint": "https://apigw.tuyaeu.com",
|
||||||
|
"terminal_id": "REDACTED",
|
||||||
|
"mqtt_connected": true,
|
||||||
|
"disabled_by": null,
|
||||||
|
"disabled_polling": false,
|
||||||
|
"id": "152027113c6105cce49c",
|
||||||
|
"name": "HL400",
|
||||||
|
"category": "kj",
|
||||||
|
"product_id": "CAjWAxBUZt7QZHfz",
|
||||||
|
"product_name": "air purifier",
|
||||||
|
"online": true,
|
||||||
|
"sub": false,
|
||||||
|
"time_zone": "+01:00",
|
||||||
|
"active_time": "2025-05-13T11:02:55+00:00",
|
||||||
|
"create_time": "2025-05-13T11:02:55+00:00",
|
||||||
|
"update_time": "2025-05-13T11:02:55+00:00",
|
||||||
|
"function": {
|
||||||
|
"switch": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"speed": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["1", "2", "3"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"anion": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"lock": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"uv": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"status_range": {
|
||||||
|
"uv": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"lock": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"anion": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"speed": {
|
||||||
|
"type": "Enum",
|
||||||
|
"value": {
|
||||||
|
"range": ["1", "2", "3"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"switch": {
|
||||||
|
"type": "Boolean",
|
||||||
|
"value": {}
|
||||||
|
},
|
||||||
|
"pm25": {
|
||||||
|
"type": "Integer",
|
||||||
|
"value": {
|
||||||
|
"unit": "",
|
||||||
|
"min": 0,
|
||||||
|
"max": 500,
|
||||||
|
"scale": 0,
|
||||||
|
"step": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"status": {
|
||||||
|
"switch": true,
|
||||||
|
"lock": false,
|
||||||
|
"anion": true,
|
||||||
|
"speed": 3,
|
||||||
|
"uv": true,
|
||||||
|
"pm25": 45
|
||||||
|
},
|
||||||
|
"set_up": true,
|
||||||
|
"support_local": true
|
||||||
|
}
|
@ -53,6 +53,56 @@
|
|||||||
'state': 'unavailable',
|
'state': 'unavailable',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[cs_qhxmvae667uap4zh][fan.dryfix-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'fan',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'fan.dryfix',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': None,
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': 'tuya.28403630e8db84b7a963',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[cs_qhxmvae667uap4zh][fan.dryfix-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'DryFix',
|
||||||
|
'supported_features': <FanEntityFeature: 0>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'fan.dryfix',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'unavailable',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_platform_setup_and_discovery[cs_vmxuxszzjwp5smli][fan.dehumidifier-entry]
|
# name: test_platform_setup_and_discovery[cs_vmxuxszzjwp5smli][fan.dehumidifier-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
@ -153,6 +203,177 @@
|
|||||||
'state': 'on',
|
'state': 'on',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[fs_g0ewlb1vmwqljzji][fan.ceiling_fan_with_light-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'preset_modes': list([
|
||||||
|
'normal',
|
||||||
|
'sleep',
|
||||||
|
'nature',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'fan',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'fan.ceiling_fan_with_light',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': None,
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': <FanEntityFeature: 61>,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': 'tuya.XXX',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[fs_g0ewlb1vmwqljzji][fan.ceiling_fan_with_light-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'direction': 'reverse',
|
||||||
|
'friendly_name': 'Ceiling Fan With Light',
|
||||||
|
'percentage': None,
|
||||||
|
'percentage_step': 16.666666666666668,
|
||||||
|
'preset_mode': 'normal',
|
||||||
|
'preset_modes': list([
|
||||||
|
'normal',
|
||||||
|
'sleep',
|
||||||
|
'nature',
|
||||||
|
]),
|
||||||
|
'supported_features': <FanEntityFeature: 61>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'fan.ceiling_fan_with_light',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[fs_ibytpo6fpnugft1c][fan.ventilador_cama-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'fan',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'fan.ventilador_cama',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': None,
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': 'tuya.10706550a4e57c88b93a',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[fs_ibytpo6fpnugft1c][fan.ventilador_cama-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'Ventilador Cama',
|
||||||
|
'supported_features': <FanEntityFeature: 0>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'fan.ventilador_cama',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'unknown',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_CAjWAxBUZt7QZHfz][fan.hl400-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'preset_modes': list([
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'fan',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'fan.hl400',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': None,
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': <FanEntityFeature: 49>,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': 'tuya.152027113c6105cce49c',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_CAjWAxBUZt7QZHfz][fan.hl400-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'HL400',
|
||||||
|
'percentage': None,
|
||||||
|
'percentage_step': 33.333333333333336,
|
||||||
|
'preset_mode': None,
|
||||||
|
'preset_modes': list([
|
||||||
|
]),
|
||||||
|
'supported_features': <FanEntityFeature: 49>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'fan.hl400',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_platform_setup_and_discovery[kj_yrzylxax1qspdgpp][fan.bree-entry]
|
# name: test_platform_setup_and_discovery[kj_yrzylxax1qspdgpp][fan.bree-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
@ -54,6 +54,61 @@
|
|||||||
'state': 'unavailable',
|
'state': 'unavailable',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[cs_qhxmvae667uap4zh][humidifier.dryfix-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'max_humidity': 100,
|
||||||
|
'min_humidity': 0,
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'humidifier',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'humidifier.dryfix',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <HumidifierDeviceClass.DEHUMIDIFIER: 'dehumidifier'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': None,
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': 'tuya.28403630e8db84b7a963switch',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[cs_qhxmvae667uap4zh][humidifier.dryfix-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'dehumidifier',
|
||||||
|
'friendly_name': 'DryFix',
|
||||||
|
'max_humidity': 100,
|
||||||
|
'min_humidity': 0,
|
||||||
|
'supported_features': <HumidifierEntityFeature: 0>,
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'humidifier.dryfix',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'unavailable',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_platform_setup_and_discovery[cs_vmxuxszzjwp5smli][humidifier.dehumidifier-entry]
|
# name: test_platform_setup_and_discovery[cs_vmxuxszzjwp5smli][humidifier.dehumidifier-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
@ -2022,6 +2022,87 @@
|
|||||||
'state': 'off',
|
'state': 'off',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[fs_g0ewlb1vmwqljzji][light.ceiling_fan_with_light-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'max_color_temp_kelvin': 6500,
|
||||||
|
'max_mireds': 500,
|
||||||
|
'min_color_temp_kelvin': 2000,
|
||||||
|
'min_mireds': 153,
|
||||||
|
'supported_color_modes': list([
|
||||||
|
<ColorMode.COLOR_TEMP: 'color_temp'>,
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'light',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'light.ceiling_fan_with_light',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': None,
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': None,
|
||||||
|
'unique_id': 'tuya.XXXlight',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[fs_g0ewlb1vmwqljzji][light.ceiling_fan_with_light-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'brightness': 255,
|
||||||
|
'color_mode': <ColorMode.COLOR_TEMP: 'color_temp'>,
|
||||||
|
'color_temp': 500,
|
||||||
|
'color_temp_kelvin': 2000,
|
||||||
|
'friendly_name': 'Ceiling Fan With Light',
|
||||||
|
'hs_color': tuple(
|
||||||
|
30.601,
|
||||||
|
94.547,
|
||||||
|
),
|
||||||
|
'max_color_temp_kelvin': 6500,
|
||||||
|
'max_mireds': 500,
|
||||||
|
'min_color_temp_kelvin': 2000,
|
||||||
|
'min_mireds': 153,
|
||||||
|
'rgb_color': tuple(
|
||||||
|
255,
|
||||||
|
137,
|
||||||
|
14,
|
||||||
|
),
|
||||||
|
'supported_color_modes': list([
|
||||||
|
<ColorMode.COLOR_TEMP: 'color_temp'>,
|
||||||
|
]),
|
||||||
|
'supported_features': <LightEntityFeature: 0>,
|
||||||
|
'xy_color': tuple(
|
||||||
|
0.598,
|
||||||
|
0.383,
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'light.ceiling_fan_with_light',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_platform_setup_and_discovery[gyd_lgekqfxdabipm3tn][light.colorful_pir_night_light-entry]
|
# name: test_platform_setup_and_discovery[gyd_lgekqfxdabipm3tn][light.colorful_pir_night_light-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
@ -414,6 +414,69 @@
|
|||||||
'state': 'unavailable',
|
'state': 'unavailable',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[fs_g0ewlb1vmwqljzji][select.ceiling_fan_with_light_countdown-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'options': list([
|
||||||
|
'cancel',
|
||||||
|
'1h',
|
||||||
|
'2h',
|
||||||
|
'4h',
|
||||||
|
'8h',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'config_subentry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'select',
|
||||||
|
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||||
|
'entity_id': 'select.ceiling_fan_with_light_countdown',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Countdown',
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'countdown',
|
||||||
|
'unique_id': 'tuya.XXXcountdown_set',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[fs_g0ewlb1vmwqljzji][select.ceiling_fan_with_light_countdown-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'Ceiling Fan With Light Countdown',
|
||||||
|
'options': list([
|
||||||
|
'cancel',
|
||||||
|
'1h',
|
||||||
|
'2h',
|
||||||
|
'4h',
|
||||||
|
'8h',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'select.ceiling_fan_with_light_countdown',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'unknown',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_platform_setup_and_discovery[kj_yrzylxax1qspdgpp][select.bree_countdown-entry]
|
# name: test_platform_setup_and_discovery[kj_yrzylxax1qspdgpp][select.bree_countdown-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
@ -970,6 +970,198 @@
|
|||||||
'state': 'unavailable',
|
'state': 'unavailable',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_CAjWAxBUZt7QZHfz][switch.hl400_child_lock-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': 'switch',
|
||||||
|
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||||
|
'entity_id': 'switch.hl400_child_lock',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Child lock',
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'child_lock',
|
||||||
|
'unique_id': 'tuya.152027113c6105cce49clock',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_CAjWAxBUZt7QZHfz][switch.hl400_child_lock-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'HL400 Child lock',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'switch.hl400_child_lock',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'off',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_CAjWAxBUZt7QZHfz][switch.hl400_ionizer-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': 'switch',
|
||||||
|
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||||
|
'entity_id': 'switch.hl400_ionizer',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Ionizer',
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'ionizer',
|
||||||
|
'unique_id': 'tuya.152027113c6105cce49canion',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_CAjWAxBUZt7QZHfz][switch.hl400_ionizer-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'HL400 Ionizer',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'switch.hl400_ionizer',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_CAjWAxBUZt7QZHfz][switch.hl400_power-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': 'switch',
|
||||||
|
'entity_category': None,
|
||||||
|
'entity_id': 'switch.hl400_power',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'Power',
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'power',
|
||||||
|
'unique_id': 'tuya.152027113c6105cce49cswitch',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_CAjWAxBUZt7QZHfz][switch.hl400_power-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'HL400 Power',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'switch.hl400_power',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_CAjWAxBUZt7QZHfz][switch.hl400_uv_sterilization-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': 'switch',
|
||||||
|
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||||
|
'entity_id': 'switch.hl400_uv_sterilization',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': None,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'UV sterilization',
|
||||||
|
'platform': 'tuya',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'suggested_object_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': 'uv_sterilization',
|
||||||
|
'unique_id': 'tuya.152027113c6105cce49cuv',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_platform_setup_and_discovery[kj_CAjWAxBUZt7QZHfz][switch.hl400_uv_sterilization-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'friendly_name': 'HL400 UV sterilization',
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'switch.hl400_uv_sterilization',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'on',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_platform_setup_and_discovery[kj_yrzylxax1qspdgpp][switch.bree_power-entry]
|
# name: test_platform_setup_and_discovery[kj_yrzylxax1qspdgpp][switch.bree_power-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user