Append name char value from the service to HomeKit Controller Entities (#74359)
This commit is contained in:
parent
737a1fd9fa
commit
30a5df5895
26 changed files with 662 additions and 145 deletions
212
tests/components/homekit_controller/fixtures/mss425f.json
Normal file
212
tests/components/homekit_controller/fixtures/mss425f.json
Normal file
|
@ -0,0 +1,212 @@
|
|||
[
|
||||
{
|
||||
"aid": 1,
|
||||
"services": [
|
||||
{
|
||||
"iid": 1,
|
||||
"type": "0000003E-0000-1000-8000-0026BB765291",
|
||||
"characteristics": [
|
||||
{
|
||||
"type": "00000014-0000-1000-8000-0026BB765291",
|
||||
"iid": 2,
|
||||
"perms": ["pw"],
|
||||
"format": "bool",
|
||||
"description": "Identify"
|
||||
},
|
||||
{
|
||||
"type": "00000020-0000-1000-8000-0026BB765291",
|
||||
"iid": 3,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "Meross",
|
||||
"description": "Manufacturer",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000021-0000-1000-8000-0026BB765291",
|
||||
"iid": 4,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "MSS425F",
|
||||
"description": "Model",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000023-0000-1000-8000-0026BB765291",
|
||||
"iid": 5,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "MSS425F-15cc",
|
||||
"description": "Name",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000030-0000-1000-8000-0026BB765291",
|
||||
"iid": 6,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "HH41234",
|
||||
"description": "Serial Number",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000052-0000-1000-8000-0026BB765291",
|
||||
"iid": 7,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "4.2.3",
|
||||
"description": "Firmware Revision",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000053-0000-1000-8000-0026BB765291",
|
||||
"iid": 8,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "4.0.0",
|
||||
"description": "Hardware Revision",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "34AB8811-AC7F-4340-BAC3-FD6A85F9943B",
|
||||
"iid": 9,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "2.0.1;16A75",
|
||||
"maxLen": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"iid": 10,
|
||||
"type": "000000A2-0000-1000-8000-0026BB765291",
|
||||
"characteristics": [
|
||||
{
|
||||
"type": "00000037-0000-1000-8000-0026BB765291",
|
||||
"iid": 11,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "1.1.0",
|
||||
"description": "Version",
|
||||
"maxLen": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"iid": 12,
|
||||
"type": "00000047-0000-1000-8000-0026BB765291",
|
||||
"characteristics": [
|
||||
{
|
||||
"type": "00000023-0000-1000-8000-0026BB765291",
|
||||
"iid": 13,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "Outlet-1",
|
||||
"description": "Name",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000025-0000-1000-8000-0026BB765291",
|
||||
"iid": 14,
|
||||
"perms": ["pr", "pw", "ev"],
|
||||
"format": "bool",
|
||||
"value": true,
|
||||
"description": "On"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"iid": 15,
|
||||
"type": "00000047-0000-1000-8000-0026BB765291",
|
||||
"characteristics": [
|
||||
{
|
||||
"type": "00000023-0000-1000-8000-0026BB765291",
|
||||
"iid": 16,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "Outlet-2",
|
||||
"description": "Name",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000025-0000-1000-8000-0026BB765291",
|
||||
"iid": 17,
|
||||
"perms": ["pr", "pw", "ev"],
|
||||
"format": "bool",
|
||||
"value": true,
|
||||
"description": "On"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"iid": 18,
|
||||
"type": "00000047-0000-1000-8000-0026BB765291",
|
||||
"characteristics": [
|
||||
{
|
||||
"type": "00000023-0000-1000-8000-0026BB765291",
|
||||
"iid": 19,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "Outlet-3",
|
||||
"description": "Name",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000025-0000-1000-8000-0026BB765291",
|
||||
"iid": 20,
|
||||
"perms": ["pr", "pw", "ev"],
|
||||
"format": "bool",
|
||||
"value": true,
|
||||
"description": "On"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"iid": 21,
|
||||
"type": "00000047-0000-1000-8000-0026BB765291",
|
||||
"characteristics": [
|
||||
{
|
||||
"type": "00000023-0000-1000-8000-0026BB765291",
|
||||
"iid": 22,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "Outlet-4",
|
||||
"description": "Name",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000025-0000-1000-8000-0026BB765291",
|
||||
"iid": 23,
|
||||
"perms": ["pr", "pw", "ev"],
|
||||
"format": "bool",
|
||||
"value": true,
|
||||
"description": "On"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"iid": 24,
|
||||
"type": "00000047-0000-1000-8000-0026BB765291",
|
||||
"characteristics": [
|
||||
{
|
||||
"type": "00000023-0000-1000-8000-0026BB765291",
|
||||
"iid": 25,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "USB",
|
||||
"description": "Name",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000025-0000-1000-8000-0026BB765291",
|
||||
"iid": 26,
|
||||
"perms": ["pr", "pw", "ev"],
|
||||
"format": "bool",
|
||||
"value": true,
|
||||
"description": "On"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
132
tests/components/homekit_controller/fixtures/mss565.json
Normal file
132
tests/components/homekit_controller/fixtures/mss565.json
Normal file
|
@ -0,0 +1,132 @@
|
|||
[
|
||||
{
|
||||
"aid": 1,
|
||||
"services": [
|
||||
{
|
||||
"iid": 1,
|
||||
"type": "0000003E-0000-1000-8000-0026BB765291",
|
||||
"characteristics": [
|
||||
{
|
||||
"type": "00000014-0000-1000-8000-0026BB765291",
|
||||
"iid": 2,
|
||||
"perms": ["pw"],
|
||||
"format": "bool",
|
||||
"description": "Identify"
|
||||
},
|
||||
{
|
||||
"type": "00000020-0000-1000-8000-0026BB765291",
|
||||
"iid": 3,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "Meross",
|
||||
"description": "Manufacturer",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000021-0000-1000-8000-0026BB765291",
|
||||
"iid": 4,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "MSS565",
|
||||
"description": "Model",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000023-0000-1000-8000-0026BB765291",
|
||||
"iid": 5,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "MSS565-28da",
|
||||
"description": "Name",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000030-0000-1000-8000-0026BB765291",
|
||||
"iid": 6,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "BB1121",
|
||||
"description": "Serial Number",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000052-0000-1000-8000-0026BB765291",
|
||||
"iid": 7,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "4.1.9",
|
||||
"description": "Firmware Revision",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "00000053-0000-1000-8000-0026BB765291",
|
||||
"iid": 8,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "4.0.0",
|
||||
"description": "Hardware Revision",
|
||||
"maxLen": 64
|
||||
},
|
||||
{
|
||||
"type": "34AB8811-AC7F-4340-BAC3-FD6A85F9943B",
|
||||
"iid": 9,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "2.0.1;16A75",
|
||||
"maxLen": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"iid": 10,
|
||||
"type": "000000A2-0000-1000-8000-0026BB765291",
|
||||
"characteristics": [
|
||||
{
|
||||
"type": "00000037-0000-1000-8000-0026BB765291",
|
||||
"iid": 11,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "1.1.0",
|
||||
"description": "Version",
|
||||
"maxLen": 64
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"iid": 12,
|
||||
"type": "00000043-0000-1000-8000-0026BB765291",
|
||||
"characteristics": [
|
||||
{
|
||||
"type": "00000025-0000-1000-8000-0026BB765291",
|
||||
"iid": 13,
|
||||
"perms": ["pr", "pw", "ev"],
|
||||
"format": "bool",
|
||||
"value": true,
|
||||
"description": "On"
|
||||
},
|
||||
{
|
||||
"type": "00000008-0000-1000-8000-0026BB765291",
|
||||
"iid": 14,
|
||||
"perms": ["pr", "pw", "ev"],
|
||||
"format": "int",
|
||||
"value": 67,
|
||||
"description": "Brightness",
|
||||
"unit": "percentage",
|
||||
"minValue": 0,
|
||||
"maxValue": 100,
|
||||
"minStep": 1
|
||||
},
|
||||
{
|
||||
"type": "00000023-0000-1000-8000-0026BB765291",
|
||||
"iid": 15,
|
||||
"perms": ["pr"],
|
||||
"format": "string",
|
||||
"value": "Dimmer Switch",
|
||||
"description": "Name",
|
||||
"maxLen": 64
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -39,8 +39,8 @@ async def test_aqara_gateway_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
"alarm_control_panel.aqara_hub_1563",
|
||||
friendly_name="Aqara Hub-1563",
|
||||
"alarm_control_panel.aqara_hub_1563_security_system",
|
||||
friendly_name="Aqara Hub-1563 Security System",
|
||||
unique_id="homekit-0000000123456789-66304",
|
||||
supported_features=SUPPORT_ALARM_ARM_NIGHT
|
||||
| SUPPORT_ALARM_ARM_HOME
|
||||
|
@ -48,8 +48,8 @@ async def test_aqara_gateway_setup(hass):
|
|||
state="disarmed",
|
||||
),
|
||||
EntityTestInfo(
|
||||
"light.aqara_hub_1563",
|
||||
friendly_name="Aqara Hub-1563",
|
||||
"light.aqara_hub_1563_lightbulb_1563",
|
||||
friendly_name="Aqara Hub-1563 Lightbulb-1563",
|
||||
unique_id="homekit-0000000123456789-65792",
|
||||
supported_features=0,
|
||||
capabilities={"supported_color_modes": ["hs"]},
|
||||
|
@ -98,8 +98,8 @@ async def test_aqara_gateway_e1_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
"alarm_control_panel.aqara_hub_e1_00a0",
|
||||
friendly_name="Aqara-Hub-E1-00A0",
|
||||
"alarm_control_panel.aqara_hub_e1_00a0_security_system",
|
||||
friendly_name="Aqara-Hub-E1-00A0 Security System",
|
||||
unique_id="homekit-00aa00000a0-16",
|
||||
supported_features=SUPPORT_ALARM_ARM_NIGHT
|
||||
| SUPPORT_ALARM_ARM_HOME
|
||||
|
|
|
@ -38,8 +38,8 @@ async def test_aqara_switch_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="sensor.programmable_switch_battery",
|
||||
friendly_name="Programmable Switch Battery",
|
||||
entity_id="sensor.programmable_switch_battery_sensor",
|
||||
friendly_name="Programmable Switch Battery Sensor",
|
||||
unique_id="homekit-111a1111a1a111-5",
|
||||
unit_of_measurement=PERCENTAGE,
|
||||
state="100",
|
||||
|
|
|
@ -37,9 +37,9 @@ async def test_arlo_baby_setup(hass):
|
|||
state="idle",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="binary_sensor.arlobabya0",
|
||||
entity_id="binary_sensor.arlobabya0_motion",
|
||||
unique_id="homekit-00A0000000000-500",
|
||||
friendly_name="ArloBabyA0",
|
||||
friendly_name="ArloBabyA0 Motion",
|
||||
state="off",
|
||||
),
|
||||
EntityTestInfo(
|
||||
|
@ -71,9 +71,9 @@ async def test_arlo_baby_setup(hass):
|
|||
state="1",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="light.arlobabya0",
|
||||
entity_id="light.arlobabya0_nightlight",
|
||||
unique_id="homekit-00A0000000000-1100",
|
||||
friendly_name="ArloBabyA0",
|
||||
friendly_name="ArloBabyA0 Nightlight",
|
||||
supported_features=0,
|
||||
capabilities={"supported_color_modes": ["hs"]},
|
||||
state="off",
|
||||
|
|
|
@ -59,8 +59,8 @@ async def test_connectsense_setup(hass):
|
|||
state="379.69299",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="switch.inwall_outlet_0394de",
|
||||
friendly_name="InWall Outlet-0394DE",
|
||||
entity_id="switch.inwall_outlet_0394de_outlet_a",
|
||||
friendly_name="InWall Outlet-0394DE Outlet A",
|
||||
unique_id="homekit-1020301376-13",
|
||||
state="on",
|
||||
),
|
||||
|
@ -89,8 +89,8 @@ async def test_connectsense_setup(hass):
|
|||
state="175.85001",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="switch.inwall_outlet_0394de_2",
|
||||
friendly_name="InWall Outlet-0394DE",
|
||||
entity_id="switch.inwall_outlet_0394de_outlet_b",
|
||||
friendly_name="InWall Outlet-0394DE Outlet B",
|
||||
unique_id="homekit-1020301376-25",
|
||||
state="on",
|
||||
),
|
||||
|
|
|
@ -43,8 +43,8 @@ async def test_koogeek_ls1_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="light.koogeek_ls1_20833f",
|
||||
friendly_name="Koogeek-LS1-20833F",
|
||||
entity_id="light.koogeek_ls1_20833f_light_strip",
|
||||
friendly_name="Koogeek-LS1-20833F Light Strip",
|
||||
unique_id="homekit-AAAA011111111111-7",
|
||||
supported_features=0,
|
||||
capabilities={"supported_color_modes": ["hs"]},
|
||||
|
@ -75,7 +75,11 @@ async def test_recover_from_failure(hass, utcnow, failure_cls):
|
|||
pairing.testing.events_enabled = False
|
||||
|
||||
helper = Helper(
|
||||
hass, "light.koogeek_ls1_20833f", pairing, accessories[0], config_entry
|
||||
hass,
|
||||
"light.koogeek_ls1_20833f_light_strip",
|
||||
pairing,
|
||||
accessories[0],
|
||||
config_entry,
|
||||
)
|
||||
|
||||
# Set light state on fake device to off
|
||||
|
|
|
@ -31,8 +31,8 @@ async def test_koogeek_p1eu_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="switch.koogeek_p1_a00aa0",
|
||||
friendly_name="Koogeek-P1-A00AA0",
|
||||
entity_id="switch.koogeek_p1_a00aa0_outlet",
|
||||
friendly_name="Koogeek-P1-A00AA0 outlet",
|
||||
unique_id="homekit-EUCP03190xxxxx48-7",
|
||||
state="off",
|
||||
),
|
||||
|
|
|
@ -37,11 +37,17 @@ async def test_koogeek_sw2_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="switch.koogeek_sw2_187a91",
|
||||
friendly_name="Koogeek-SW2-187A91",
|
||||
entity_id="switch.koogeek_sw2_187a91_switch_1",
|
||||
friendly_name="Koogeek-SW2-187A91 Switch 1",
|
||||
unique_id="homekit-CNNT061751001372-8",
|
||||
state="off",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="switch.koogeek_sw2_187a91_switch_2",
|
||||
friendly_name="Koogeek-SW2-187A91 Switch 2",
|
||||
unique_id="homekit-CNNT061751001372-11",
|
||||
state="off",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="sensor.koogeek_sw2_187a91_power",
|
||||
friendly_name="Koogeek-SW2-187A91 Power",
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
"""Tests for the Meross MSS425f power strip."""
|
||||
|
||||
|
||||
from homeassistant.const import STATE_ON, STATE_UNKNOWN
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
|
||||
from tests.components.homekit_controller.common import (
|
||||
HUB_TEST_ACCESSORY_ID,
|
||||
DeviceTestInfo,
|
||||
EntityTestInfo,
|
||||
assert_devices_and_entities_created,
|
||||
setup_accessories_from_file,
|
||||
setup_test_accessories,
|
||||
)
|
||||
|
||||
|
||||
async def test_meross_mss425f_setup(hass):
|
||||
"""Test that a MSS425f can be correctly setup in HA."""
|
||||
accessories = await setup_accessories_from_file(hass, "mss425f.json")
|
||||
await setup_test_accessories(hass, accessories)
|
||||
|
||||
await assert_devices_and_entities_created(
|
||||
hass,
|
||||
DeviceTestInfo(
|
||||
unique_id=HUB_TEST_ACCESSORY_ID,
|
||||
name="MSS425F-15cc",
|
||||
model="MSS425F",
|
||||
manufacturer="Meross",
|
||||
sw_version="4.2.3",
|
||||
hw_version="4.0.0",
|
||||
serial_number="HH41234",
|
||||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="button.mss425f_15cc_identify",
|
||||
friendly_name="MSS425F-15cc Identify",
|
||||
unique_id="homekit-HH41234-aid:1-sid:1-cid:2",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
state=STATE_UNKNOWN,
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="switch.mss425f_15cc_outlet_1",
|
||||
friendly_name="MSS425F-15cc Outlet-1",
|
||||
unique_id="homekit-HH41234-12",
|
||||
state=STATE_ON,
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="switch.mss425f_15cc_outlet_2",
|
||||
friendly_name="MSS425F-15cc Outlet-2",
|
||||
unique_id="homekit-HH41234-15",
|
||||
state=STATE_ON,
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="switch.mss425f_15cc_outlet_3",
|
||||
friendly_name="MSS425F-15cc Outlet-3",
|
||||
unique_id="homekit-HH41234-18",
|
||||
state=STATE_ON,
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="switch.mss425f_15cc_outlet_4",
|
||||
friendly_name="MSS425F-15cc Outlet-4",
|
||||
unique_id="homekit-HH41234-21",
|
||||
state=STATE_ON,
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="switch.mss425f_15cc_usb",
|
||||
friendly_name="MSS425F-15cc USB",
|
||||
unique_id="homekit-HH41234-24",
|
||||
state=STATE_ON,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
|
@ -0,0 +1,42 @@
|
|||
"""Tests for the Meross MSS565 wall switch."""
|
||||
|
||||
|
||||
from homeassistant.const import STATE_ON
|
||||
|
||||
from tests.components.homekit_controller.common import (
|
||||
HUB_TEST_ACCESSORY_ID,
|
||||
DeviceTestInfo,
|
||||
EntityTestInfo,
|
||||
assert_devices_and_entities_created,
|
||||
setup_accessories_from_file,
|
||||
setup_test_accessories,
|
||||
)
|
||||
|
||||
|
||||
async def test_meross_mss565_setup(hass):
|
||||
"""Test that a MSS565 can be correctly setup in HA."""
|
||||
accessories = await setup_accessories_from_file(hass, "mss565.json")
|
||||
await setup_test_accessories(hass, accessories)
|
||||
|
||||
await assert_devices_and_entities_created(
|
||||
hass,
|
||||
DeviceTestInfo(
|
||||
unique_id=HUB_TEST_ACCESSORY_ID,
|
||||
name="MSS565-28da",
|
||||
model="MSS565",
|
||||
manufacturer="Meross",
|
||||
sw_version="4.1.9",
|
||||
hw_version="4.0.0",
|
||||
serial_number="BB1121",
|
||||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="light.mss565_28da_dimmer_switch",
|
||||
friendly_name="MSS565-28da Dimmer Switch",
|
||||
unique_id="homekit-BB1121-12",
|
||||
capabilities={"supported_color_modes": ["brightness"]},
|
||||
state=STATE_ON,
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
|
@ -32,8 +32,8 @@ async def test_mysa_living_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="climate.mysa_85dda9",
|
||||
friendly_name="Mysa-85dda9",
|
||||
entity_id="climate.mysa_85dda9_thermostat",
|
||||
friendly_name="Mysa-85dda9 Thermostat",
|
||||
unique_id="homekit-AAAAAAA000-20",
|
||||
supported_features=SUPPORT_TARGET_TEMPERATURE,
|
||||
capabilities={
|
||||
|
@ -60,8 +60,8 @@ async def test_mysa_living_setup(hass):
|
|||
state="24.1",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="light.mysa_85dda9",
|
||||
friendly_name="Mysa-85dda9",
|
||||
entity_id="light.mysa_85dda9_display",
|
||||
friendly_name="Mysa-85dda9 Display",
|
||||
unique_id="homekit-AAAAAAA000-40",
|
||||
supported_features=0,
|
||||
capabilities={"supported_color_modes": ["brightness"]},
|
||||
|
|
|
@ -45,15 +45,15 @@ async def test_ryse_smart_bridge_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="cover.master_bath_south",
|
||||
friendly_name="Master Bath South",
|
||||
entity_id="cover.master_bath_south_ryse_shade",
|
||||
friendly_name="Master Bath South RYSE Shade",
|
||||
unique_id="homekit-00:00:00:00:00:00-2-48",
|
||||
supported_features=RYSE_SUPPORTED_FEATURES,
|
||||
state="closed",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="sensor.master_bath_south_battery",
|
||||
friendly_name="Master Bath South Battery",
|
||||
entity_id="sensor.master_bath_south_ryse_shade_battery",
|
||||
friendly_name="Master Bath South RYSE Shade Battery",
|
||||
unique_id="homekit-00:00:00:00:00:00-2-64",
|
||||
unit_of_measurement=PERCENTAGE,
|
||||
state="100",
|
||||
|
@ -71,15 +71,15 @@ async def test_ryse_smart_bridge_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="cover.ryse_smartshade",
|
||||
friendly_name="RYSE SmartShade",
|
||||
entity_id="cover.ryse_smartshade_ryse_shade",
|
||||
friendly_name="RYSE SmartShade RYSE Shade",
|
||||
unique_id="homekit-00:00:00:00:00:00-3-48",
|
||||
supported_features=RYSE_SUPPORTED_FEATURES,
|
||||
state="open",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="sensor.ryse_smartshade_battery",
|
||||
friendly_name="RYSE SmartShade Battery",
|
||||
entity_id="sensor.ryse_smartshade_ryse_shade_battery",
|
||||
friendly_name="RYSE SmartShade RYSE Shade Battery",
|
||||
unique_id="homekit-00:00:00:00:00:00-3-64",
|
||||
unit_of_measurement=PERCENTAGE,
|
||||
state="100",
|
||||
|
@ -120,15 +120,15 @@ async def test_ryse_smart_bridge_four_shades_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="cover.lr_left",
|
||||
friendly_name="LR Left",
|
||||
entity_id="cover.lr_left_ryse_shade",
|
||||
friendly_name="LR Left RYSE Shade",
|
||||
unique_id="homekit-00:00:00:00:00:00-2-48",
|
||||
supported_features=RYSE_SUPPORTED_FEATURES,
|
||||
state="closed",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="sensor.lr_left_battery",
|
||||
friendly_name="LR Left Battery",
|
||||
entity_id="sensor.lr_left_ryse_shade_battery",
|
||||
friendly_name="LR Left RYSE Shade Battery",
|
||||
unique_id="homekit-00:00:00:00:00:00-2-64",
|
||||
unit_of_measurement=PERCENTAGE,
|
||||
state="89",
|
||||
|
@ -146,15 +146,15 @@ async def test_ryse_smart_bridge_four_shades_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="cover.lr_right",
|
||||
friendly_name="LR Right",
|
||||
entity_id="cover.lr_right_ryse_shade",
|
||||
friendly_name="LR Right RYSE Shade",
|
||||
unique_id="homekit-00:00:00:00:00:00-3-48",
|
||||
supported_features=RYSE_SUPPORTED_FEATURES,
|
||||
state="closed",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="sensor.lr_right_battery",
|
||||
friendly_name="LR Right Battery",
|
||||
entity_id="sensor.lr_right_ryse_shade_battery",
|
||||
friendly_name="LR Right RYSE Shade Battery",
|
||||
unique_id="homekit-00:00:00:00:00:00-3-64",
|
||||
unit_of_measurement=PERCENTAGE,
|
||||
state="100",
|
||||
|
@ -172,15 +172,15 @@ async def test_ryse_smart_bridge_four_shades_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="cover.br_left",
|
||||
friendly_name="BR Left",
|
||||
entity_id="cover.br_left_ryse_shade",
|
||||
friendly_name="BR Left RYSE Shade",
|
||||
unique_id="homekit-00:00:00:00:00:00-4-48",
|
||||
supported_features=RYSE_SUPPORTED_FEATURES,
|
||||
state="open",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="sensor.br_left_battery",
|
||||
friendly_name="BR Left Battery",
|
||||
entity_id="sensor.br_left_ryse_shade_battery",
|
||||
friendly_name="BR Left RYSE Shade Battery",
|
||||
unique_id="homekit-00:00:00:00:00:00-4-64",
|
||||
unit_of_measurement=PERCENTAGE,
|
||||
state="100",
|
||||
|
@ -198,15 +198,15 @@ async def test_ryse_smart_bridge_four_shades_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="cover.rzss",
|
||||
friendly_name="RZSS",
|
||||
entity_id="cover.rzss_ryse_shade",
|
||||
friendly_name="RZSS RYSE Shade",
|
||||
unique_id="homekit-00:00:00:00:00:00-5-48",
|
||||
supported_features=RYSE_SUPPORTED_FEATURES,
|
||||
state="open",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="sensor.rzss_battery",
|
||||
friendly_name="RZSS Battery",
|
||||
entity_id="sensor.rzss_ryse_shade_battery",
|
||||
friendly_name="RZSS RYSE Shade Battery",
|
||||
unique_id="homekit-00:00:00:00:00:00-5-64",
|
||||
unit_of_measurement=PERCENTAGE,
|
||||
state="0",
|
||||
|
|
|
@ -34,8 +34,8 @@ async def test_simpleconnect_fan_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="fan.simpleconnect_fan_06f674",
|
||||
friendly_name="SIMPLEconnect Fan-06F674",
|
||||
entity_id="fan.simpleconnect_fan_06f674_hunter_fan",
|
||||
friendly_name="SIMPLEconnect Fan-06F674 Hunter Fan",
|
||||
unique_id="homekit-1234567890abcd-8",
|
||||
supported_features=SUPPORT_DIRECTION | SUPPORT_SET_SPEED,
|
||||
capabilities={
|
||||
|
|
|
@ -52,8 +52,8 @@ async def test_velux_cover_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="cover.velux_window",
|
||||
friendly_name="VELUX Window",
|
||||
entity_id="cover.velux_window_roof_window",
|
||||
friendly_name="VELUX Window Roof Window",
|
||||
unique_id="homekit-1111111a114a111a-8",
|
||||
supported_features=SUPPORT_CLOSE
|
||||
| SUPPORT_SET_POSITION
|
||||
|
@ -73,22 +73,22 @@ async def test_velux_cover_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="sensor.velux_sensor_temperature",
|
||||
friendly_name="VELUX Sensor Temperature",
|
||||
entity_id="sensor.velux_sensor_temperature_sensor",
|
||||
friendly_name="VELUX Sensor Temperature sensor",
|
||||
unique_id="homekit-a11b111-8",
|
||||
unit_of_measurement=TEMP_CELSIUS,
|
||||
state="18.9",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="sensor.velux_sensor_humidity",
|
||||
friendly_name="VELUX Sensor Humidity",
|
||||
entity_id="sensor.velux_sensor_humidity_sensor",
|
||||
friendly_name="VELUX Sensor Humidity sensor",
|
||||
unique_id="homekit-a11b111-11",
|
||||
unit_of_measurement=PERCENTAGE,
|
||||
state="58",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="sensor.velux_sensor_co2",
|
||||
friendly_name="VELUX Sensor CO2",
|
||||
entity_id="sensor.velux_sensor_carbon_dioxide_sensor",
|
||||
friendly_name="VELUX Sensor Carbon Dioxide sensor",
|
||||
unique_id="homekit-a11b111-14",
|
||||
unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
|
||||
state="400",
|
||||
|
|
|
@ -46,8 +46,8 @@ async def test_vocolinc_flowerbud_setup(hass):
|
|||
state="off",
|
||||
),
|
||||
EntityTestInfo(
|
||||
entity_id="light.vocolinc_flowerbud_0d324b",
|
||||
friendly_name="VOCOlinc-Flowerbud-0d324b",
|
||||
entity_id="light.vocolinc_flowerbud_0d324b_mood_light",
|
||||
friendly_name="VOCOlinc-Flowerbud-0d324b Mood Light",
|
||||
unique_id="homekit-AM01121849000327-9",
|
||||
supported_features=0,
|
||||
capabilities={"supported_color_modes": ["hs"]},
|
||||
|
|
|
@ -31,8 +31,8 @@ async def test_vocolinc_vp3_setup(hass):
|
|||
devices=[],
|
||||
entities=[
|
||||
EntityTestInfo(
|
||||
entity_id="switch.vocolinc_vp3_123456",
|
||||
friendly_name="VOCOlinc-VP3-123456",
|
||||
entity_id="switch.vocolinc_vp3_123456_outlet",
|
||||
friendly_name="VOCOlinc-VP3-123456 Outlet",
|
||||
unique_id="homekit-EU0121203xxxxx07-48",
|
||||
state="on",
|
||||
),
|
||||
|
|
|
@ -234,28 +234,6 @@ async def test_config_entry(hass: HomeAssistant, hass_client: ClientSession, utc
|
|||
"sw_version": "2.2.15",
|
||||
"hw_version": "",
|
||||
"entities": [
|
||||
{
|
||||
"original_name": "Koogeek-LS1-20833F",
|
||||
"disabled": False,
|
||||
"disabled_by": None,
|
||||
"entity_category": None,
|
||||
"device_class": None,
|
||||
"original_device_class": None,
|
||||
"icon": None,
|
||||
"original_icon": None,
|
||||
"unit_of_measurement": None,
|
||||
"state": {
|
||||
"entity_id": "light.koogeek_ls1_20833f",
|
||||
"state": "off",
|
||||
"attributes": {
|
||||
"supported_color_modes": ["hs"],
|
||||
"friendly_name": "Koogeek-LS1-20833F",
|
||||
"supported_features": 0,
|
||||
},
|
||||
"last_changed": "2023-01-01T00:00:00+00:00",
|
||||
"last_updated": "2023-01-01T00:00:00+00:00",
|
||||
},
|
||||
},
|
||||
{
|
||||
"device_class": None,
|
||||
"disabled": False,
|
||||
|
@ -276,6 +254,28 @@ async def test_config_entry(hass: HomeAssistant, hass_client: ClientSession, utc
|
|||
},
|
||||
"unit_of_measurement": None,
|
||||
},
|
||||
{
|
||||
"device_class": None,
|
||||
"disabled": False,
|
||||
"disabled_by": None,
|
||||
"entity_category": None,
|
||||
"icon": None,
|
||||
"original_device_class": None,
|
||||
"original_icon": None,
|
||||
"original_name": "Koogeek-LS1-20833F Light Strip",
|
||||
"state": {
|
||||
"attributes": {
|
||||
"friendly_name": "Koogeek-LS1-20833F Light Strip",
|
||||
"supported_color_modes": ["hs"],
|
||||
"supported_features": 0,
|
||||
},
|
||||
"entity_id": "light.koogeek_ls1_20833f_light_strip",
|
||||
"last_changed": "2023-01-01T00:00:00+00:00",
|
||||
"last_updated": "2023-01-01T00:00:00+00:00",
|
||||
"state": "off",
|
||||
},
|
||||
"unit_of_measurement": None,
|
||||
},
|
||||
],
|
||||
}
|
||||
],
|
||||
|
@ -504,28 +504,6 @@ async def test_device(hass: HomeAssistant, hass_client: ClientSession, utcnow):
|
|||
"sw_version": "2.2.15",
|
||||
"hw_version": "",
|
||||
"entities": [
|
||||
{
|
||||
"original_name": "Koogeek-LS1-20833F",
|
||||
"disabled": False,
|
||||
"disabled_by": None,
|
||||
"entity_category": None,
|
||||
"device_class": None,
|
||||
"original_device_class": None,
|
||||
"icon": None,
|
||||
"original_icon": None,
|
||||
"unit_of_measurement": None,
|
||||
"state": {
|
||||
"entity_id": "light.koogeek_ls1_20833f",
|
||||
"state": "off",
|
||||
"attributes": {
|
||||
"supported_color_modes": ["hs"],
|
||||
"friendly_name": "Koogeek-LS1-20833F",
|
||||
"supported_features": 0,
|
||||
},
|
||||
"last_changed": "2023-01-01T00:00:00+00:00",
|
||||
"last_updated": "2023-01-01T00:00:00+00:00",
|
||||
},
|
||||
},
|
||||
{
|
||||
"device_class": None,
|
||||
"disabled": False,
|
||||
|
@ -536,7 +514,9 @@ async def test_device(hass: HomeAssistant, hass_client: ClientSession, utcnow):
|
|||
"original_icon": None,
|
||||
"original_name": "Koogeek-LS1-20833F Identify",
|
||||
"state": {
|
||||
"attributes": {"friendly_name": "Koogeek-LS1-20833F Identify"},
|
||||
"attributes": {
|
||||
"friendly_name": "Koogeek-LS1-20833F " "Identify"
|
||||
},
|
||||
"entity_id": "button.koogeek_ls1_20833f_identify",
|
||||
"last_changed": "2023-01-01T00:00:00+00:00",
|
||||
"last_updated": "2023-01-01T00:00:00+00:00",
|
||||
|
@ -544,6 +524,28 @@ async def test_device(hass: HomeAssistant, hass_client: ClientSession, utcnow):
|
|||
},
|
||||
"unit_of_measurement": None,
|
||||
},
|
||||
{
|
||||
"device_class": None,
|
||||
"disabled": False,
|
||||
"disabled_by": None,
|
||||
"entity_category": None,
|
||||
"icon": None,
|
||||
"original_device_class": None,
|
||||
"original_icon": None,
|
||||
"original_name": "Koogeek-LS1-20833F Light Strip",
|
||||
"state": {
|
||||
"attributes": {
|
||||
"friendly_name": "Koogeek-LS1-20833F Light Strip",
|
||||
"supported_color_modes": ["hs"],
|
||||
"supported_features": 0,
|
||||
},
|
||||
"entity_id": "light.koogeek_ls1_20833f_light_strip",
|
||||
"last_changed": "2023-01-01T00:00:00+00:00",
|
||||
"last_updated": "2023-01-01T00:00:00+00:00",
|
||||
"state": "off",
|
||||
},
|
||||
"unit_of_measurement": None,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@ from .common import Helper, remove_device
|
|||
|
||||
from tests.components.homekit_controller.common import setup_test_component
|
||||
|
||||
ALIVE_DEVICE_NAME = "Light Bulb"
|
||||
ALIVE_DEEVICE_ENTITY_ID = "light.testdevice"
|
||||
ALIVE_DEVICE_NAME = "testdevice"
|
||||
ALIVE_DEVICE_ENTITY_ID = "light.testdevice"
|
||||
|
||||
|
||||
def create_motion_sensor_service(accessory):
|
||||
|
@ -72,7 +72,7 @@ async def test_device_remove_devices(hass, hass_ws_client):
|
|||
entry_id = config_entry.entry_id
|
||||
|
||||
registry: EntityRegistry = er.async_get(hass)
|
||||
entity = registry.entities[ALIVE_DEEVICE_ENTITY_ID]
|
||||
entity = registry.entities[ALIVE_DEVICE_ENTITY_ID]
|
||||
device_registry = dr.async_get(hass)
|
||||
|
||||
live_device_entry = device_registry.async_get(entity.device_id)
|
||||
|
|
|
@ -12,7 +12,7 @@ from homeassistant.const import ATTR_SUPPORTED_FEATURES, STATE_UNAVAILABLE
|
|||
|
||||
from tests.components.homekit_controller.common import setup_test_component
|
||||
|
||||
LIGHT_BULB_NAME = "Light Bulb"
|
||||
LIGHT_BULB_NAME = "TestDevice"
|
||||
LIGHT_BULB_ENTITY_ID = "light.testdevice"
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue