mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Bump HAP-python to 4.1.0 (#55005)
This commit is contained in:
parent
a5c1fbcb1a
commit
99465f53c7
@ -532,11 +532,6 @@ class HomeKit:
|
|||||||
# as pyhap uses a random one until state is restored
|
# as pyhap uses a random one until state is restored
|
||||||
if os.path.exists(persist_file):
|
if os.path.exists(persist_file):
|
||||||
self.driver.load()
|
self.driver.load()
|
||||||
self.driver.state.config_version += 1
|
|
||||||
if self.driver.state.config_version > 65535:
|
|
||||||
self.driver.state.config_version = 1
|
|
||||||
|
|
||||||
self.driver.persist()
|
|
||||||
|
|
||||||
async def async_reset_accessories(self, entity_ids):
|
async def async_reset_accessories(self, entity_ids):
|
||||||
"""Reset the accessory to load the latest configuration."""
|
"""Reset the accessory to load the latest configuration."""
|
||||||
@ -688,6 +683,7 @@ class HomeKit:
|
|||||||
self._async_register_bridge()
|
self._async_register_bridge()
|
||||||
_LOGGER.debug("Driver start for %s", self._name)
|
_LOGGER.debug("Driver start for %s", self._name)
|
||||||
await self.driver.async_start()
|
await self.driver.async_start()
|
||||||
|
self.driver.async_persist()
|
||||||
self.status = STATUS_RUNNING
|
self.status = STATUS_RUNNING
|
||||||
|
|
||||||
if self.driver.state.paired:
|
if self.driver.state.paired:
|
||||||
|
@ -528,9 +528,9 @@ class HomeDriver(AccessoryDriver):
|
|||||||
self._bridge_name = bridge_name
|
self._bridge_name = bridge_name
|
||||||
self._entry_title = entry_title
|
self._entry_title = entry_title
|
||||||
|
|
||||||
def pair(self, client_uuid, client_public):
|
def pair(self, client_uuid, client_public, client_permissions):
|
||||||
"""Override super function to dismiss setup message if paired."""
|
"""Override super function to dismiss setup message if paired."""
|
||||||
success = super().pair(client_uuid, client_public)
|
success = super().pair(client_uuid, client_public, client_permissions)
|
||||||
if success:
|
if success:
|
||||||
dismiss_setup_message(self.hass, self._entry_id)
|
dismiss_setup_message(self.hass, self._entry_id)
|
||||||
return success
|
return success
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "HomeKit",
|
"name": "HomeKit",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/homekit",
|
"documentation": "https://www.home-assistant.io/integrations/homekit",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"HAP-python==4.0.0",
|
"HAP-python==4.1.0",
|
||||||
"fnvhash==0.1.0",
|
"fnvhash==0.1.0",
|
||||||
"PyQRCode==1.2.1",
|
"PyQRCode==1.2.1",
|
||||||
"base36==0.1.1"
|
"base36==0.1.1"
|
||||||
|
@ -14,7 +14,7 @@ Adafruit-SHT31==1.0.2
|
|||||||
# Adafruit_BBIO==1.1.1
|
# Adafruit_BBIO==1.1.1
|
||||||
|
|
||||||
# homeassistant.components.homekit
|
# homeassistant.components.homekit
|
||||||
HAP-python==4.0.0
|
HAP-python==4.1.0
|
||||||
|
|
||||||
# homeassistant.components.mastodon
|
# homeassistant.components.mastodon
|
||||||
Mastodon.py==1.5.1
|
Mastodon.py==1.5.1
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
AEMET-OpenData==0.2.1
|
AEMET-OpenData==0.2.1
|
||||||
|
|
||||||
# homeassistant.components.homekit
|
# homeassistant.components.homekit
|
||||||
HAP-python==4.0.0
|
HAP-python==4.1.0
|
||||||
|
|
||||||
# homeassistant.components.flick_electric
|
# homeassistant.components.flick_electric
|
||||||
PyFlick==0.0.2
|
PyFlick==0.0.2
|
||||||
|
@ -696,9 +696,9 @@ def test_home_driver():
|
|||||||
with patch("pyhap.accessory_driver.AccessoryDriver.pair") as mock_pair, patch(
|
with patch("pyhap.accessory_driver.AccessoryDriver.pair") as mock_pair, patch(
|
||||||
"homeassistant.components.homekit.accessories.dismiss_setup_message"
|
"homeassistant.components.homekit.accessories.dismiss_setup_message"
|
||||||
) as mock_dissmiss_msg:
|
) as mock_dissmiss_msg:
|
||||||
driver.pair("client_uuid", "client_public")
|
driver.pair("client_uuid", "client_public", b"1")
|
||||||
|
|
||||||
mock_pair.assert_called_with("client_uuid", "client_public")
|
mock_pair.assert_called_with("client_uuid", "client_public", b"1")
|
||||||
mock_dissmiss_msg.assert_called_with("hass", "entry_id")
|
mock_dissmiss_msg.assert_called_with("hass", "entry_id")
|
||||||
|
|
||||||
# unpair
|
# unpair
|
||||||
|
@ -560,7 +560,7 @@ async def test_homekit_start(hass, hk_driver, mock_zeroconf, device_reg):
|
|||||||
assert (device_registry.CONNECTION_NETWORK_MAC, formatted_mac) in device.connections
|
assert (device_registry.CONNECTION_NETWORK_MAC, formatted_mac) in device.connections
|
||||||
|
|
||||||
assert len(device_reg.devices) == 1
|
assert len(device_reg.devices) == 1
|
||||||
assert homekit.driver.state.config_version == 2
|
assert homekit.driver.state.config_version == 1
|
||||||
|
|
||||||
|
|
||||||
async def test_homekit_start_with_a_broken_accessory(hass, hk_driver, mock_zeroconf):
|
async def test_homekit_start_with_a_broken_accessory(hass, hk_driver, mock_zeroconf):
|
||||||
@ -695,7 +695,7 @@ async def test_homekit_unpair(hass, device_reg, mock_zeroconf):
|
|||||||
homekit.status = STATUS_RUNNING
|
homekit.status = STATUS_RUNNING
|
||||||
|
|
||||||
state = homekit.driver.state
|
state = homekit.driver.state
|
||||||
state.paired_clients = {"client1": "any"}
|
state.add_paired_client("client1", "any", b"1")
|
||||||
formatted_mac = device_registry.format_mac(state.mac)
|
formatted_mac = device_registry.format_mac(state.mac)
|
||||||
hk_bridge_dev = device_reg.async_get_device(
|
hk_bridge_dev = device_reg.async_get_device(
|
||||||
{}, {(device_registry.CONNECTION_NETWORK_MAC, formatted_mac)}
|
{}, {(device_registry.CONNECTION_NETWORK_MAC, formatted_mac)}
|
||||||
@ -734,7 +734,7 @@ async def test_homekit_unpair_missing_device_id(hass, device_reg, mock_zeroconf)
|
|||||||
homekit.status = STATUS_RUNNING
|
homekit.status = STATUS_RUNNING
|
||||||
|
|
||||||
state = homekit.driver.state
|
state = homekit.driver.state
|
||||||
state.paired_clients = {"client1": "any"}
|
state.add_paired_client("client1", "any", b"1")
|
||||||
with pytest.raises(HomeAssistantError):
|
with pytest.raises(HomeAssistantError):
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
@ -780,7 +780,7 @@ async def test_homekit_unpair_not_homekit_device(hass, device_reg, mock_zeroconf
|
|||||||
)
|
)
|
||||||
|
|
||||||
state = homekit.driver.state
|
state = homekit.driver.state
|
||||||
state.paired_clients = {"client1": "any"}
|
state.add_paired_client("client1", "any", b"1")
|
||||||
with pytest.raises(HomeAssistantError):
|
with pytest.raises(HomeAssistantError):
|
||||||
await hass.services.async_call(
|
await hass.services.async_call(
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user