Fix homebridge devices becoming unavailable frequently (#52753)
Update to aiohomekit 0.4.3 and make sure service type UUID is normalised before comparison Co-authored-by: J. Nick Koston <nick@koston.org>
This commit is contained in:
parent
49181d6ba8
commit
5b257d2be8
5 changed files with 15 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
||||||
"name": "HomeKit Controller",
|
"name": "HomeKit Controller",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/homekit_controller",
|
"documentation": "https://www.home-assistant.io/integrations/homekit_controller",
|
||||||
"requirements": ["aiohomekit==0.4.2"],
|
"requirements": ["aiohomekit==0.4.3"],
|
||||||
"zeroconf": ["_hap._tcp.local."],
|
"zeroconf": ["_hap._tcp.local."],
|
||||||
"after_dependencies": ["zeroconf"],
|
"after_dependencies": ["zeroconf"],
|
||||||
"codeowners": ["@Jc2k", "@bdraco"],
|
"codeowners": ["@Jc2k", "@bdraco"],
|
||||||
|
|
|
@ -44,7 +44,8 @@ SIMPLE_SENSOR = {
|
||||||
"unit": TEMP_CELSIUS,
|
"unit": TEMP_CELSIUS,
|
||||||
# This sensor is only for temperature characteristics that are not part
|
# This sensor is only for temperature characteristics that are not part
|
||||||
# of a temperature sensor service.
|
# of a temperature sensor service.
|
||||||
"probe": lambda char: char.service.type != ServicesTypes.TEMPERATURE_SENSOR,
|
"probe": lambda char: char.service.type
|
||||||
|
!= ServicesTypes.get_uuid(ServicesTypes.TEMPERATURE_SENSOR),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -175,7 +175,7 @@ aioguardian==1.0.4
|
||||||
aioharmony==0.2.7
|
aioharmony==0.2.7
|
||||||
|
|
||||||
# homeassistant.components.homekit_controller
|
# homeassistant.components.homekit_controller
|
||||||
aiohomekit==0.4.2
|
aiohomekit==0.4.3
|
||||||
|
|
||||||
# homeassistant.components.emulated_hue
|
# homeassistant.components.emulated_hue
|
||||||
# homeassistant.components.http
|
# homeassistant.components.http
|
||||||
|
|
|
@ -112,7 +112,7 @@ aioguardian==1.0.4
|
||||||
aioharmony==0.2.7
|
aioharmony==0.2.7
|
||||||
|
|
||||||
# homeassistant.components.homekit_controller
|
# homeassistant.components.homekit_controller
|
||||||
aiohomekit==0.4.2
|
aiohomekit==0.4.3
|
||||||
|
|
||||||
# homeassistant.components.emulated_hue
|
# homeassistant.components.emulated_hue
|
||||||
# homeassistant.components.http
|
# homeassistant.components.http
|
||||||
|
|
|
@ -86,6 +86,16 @@ async def test_temperature_sensor_read_state(hass, utcnow):
|
||||||
assert state.attributes["device_class"] == DEVICE_CLASS_TEMPERATURE
|
assert state.attributes["device_class"] == DEVICE_CLASS_TEMPERATURE
|
||||||
|
|
||||||
|
|
||||||
|
async def test_temperature_sensor_not_added_twice(hass, utcnow):
|
||||||
|
"""A standalone temperature sensor should not get a characteristic AND a service entity."""
|
||||||
|
helper = await setup_test_component(
|
||||||
|
hass, create_temperature_sensor_service, suffix="temperature"
|
||||||
|
)
|
||||||
|
|
||||||
|
for state in hass.states.async_all():
|
||||||
|
assert state.entity_id == helper.entity_id
|
||||||
|
|
||||||
|
|
||||||
async def test_humidity_sensor_read_state(hass, utcnow):
|
async def test_humidity_sensor_read_state(hass, utcnow):
|
||||||
"""Test reading the state of a HomeKit humidity sensor accessory."""
|
"""Test reading the state of a HomeKit humidity sensor accessory."""
|
||||||
helper = await setup_test_component(
|
helper = await setup_test_component(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue