mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
homekit_controller: Bump homekit to 0.13.0 (#21965)
* Bump homekit to 0.13.0 * Update gen_requirements_all.py * Escape values used in TESTS_REQUIREMENTS
This commit is contained in:
parent
d3960bf745
commit
2b1b47bfdd
@ -15,7 +15,7 @@ from .const import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
REQUIREMENTS = ['homekit==0.12.2']
|
REQUIREMENTS = ['homekit[IP]==0.13.0']
|
||||||
|
|
||||||
HOMEKIT_DIR = '.homekit'
|
HOMEKIT_DIR = '.homekit'
|
||||||
|
|
||||||
@ -314,7 +314,7 @@ def setup(hass, config):
|
|||||||
"""Set up for Homekit devices."""
|
"""Set up for Homekit devices."""
|
||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
import homekit
|
import homekit
|
||||||
from homekit.controller import Pairing
|
from homekit.controller.ip_implementation import IpPairing
|
||||||
|
|
||||||
hass.data[CONTROLLER] = controller = homekit.Controller()
|
hass.data[CONTROLLER] = controller = homekit.Controller()
|
||||||
|
|
||||||
@ -335,7 +335,7 @@ def setup(hass, config):
|
|||||||
continue
|
continue
|
||||||
with open(os.path.join(data_dir, device)) as pairing_data_fp:
|
with open(os.path.join(data_dir, device)) as pairing_data_fp:
|
||||||
pairing_data = json.load(pairing_data_fp)
|
pairing_data = json.load(pairing_data_fp)
|
||||||
controller.pairings[alias] = Pairing(pairing_data)
|
controller.pairings[alias] = IpPairing(pairing_data)
|
||||||
controller.save_data(pairing_file)
|
controller.save_data(pairing_file)
|
||||||
|
|
||||||
def discovery_dispatch(service, discovery_info):
|
def discovery_dispatch(service, discovery_info):
|
||||||
|
@ -189,7 +189,7 @@ class HomekitControllerFlowHandler(config_entries.ConfigFlow):
|
|||||||
|
|
||||||
async def async_import_legacy_pairing(self, discovery_props, pairing_data):
|
async def async_import_legacy_pairing(self, discovery_props, pairing_data):
|
||||||
"""Migrate a legacy pairing to config entries."""
|
"""Migrate a legacy pairing to config entries."""
|
||||||
from homekit.controller import Pairing
|
from homekit.controller.ip_implementation import IpPairing
|
||||||
|
|
||||||
hkid = discovery_props['id']
|
hkid = discovery_props['id']
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ class HomekitControllerFlowHandler(config_entries.ConfigFlow):
|
|||||||
("Legacy configuration %s for homekit"
|
("Legacy configuration %s for homekit"
|
||||||
"accessory migrated to config entries"), hkid)
|
"accessory migrated to config entries"), hkid)
|
||||||
|
|
||||||
pairing = Pairing(pairing_data)
|
pairing = IpPairing(pairing_data)
|
||||||
|
|
||||||
return await self._entry_from_accessory(pairing)
|
return await self._entry_from_accessory(pairing)
|
||||||
|
|
||||||
|
@ -560,7 +560,7 @@ home-assistant-frontend==20190312.0
|
|||||||
homeassistant-pyozw==0.1.2
|
homeassistant-pyozw==0.1.2
|
||||||
|
|
||||||
# homeassistant.components.homekit_controller
|
# homeassistant.components.homekit_controller
|
||||||
homekit==0.12.2
|
homekit[IP]==0.13.0
|
||||||
|
|
||||||
# homeassistant.components.homematicip_cloud
|
# homeassistant.components.homematicip_cloud
|
||||||
homematicip==0.10.6
|
homematicip==0.10.6
|
||||||
|
@ -129,7 +129,7 @@ holidays==0.9.9
|
|||||||
home-assistant-frontend==20190312.0
|
home-assistant-frontend==20190312.0
|
||||||
|
|
||||||
# homeassistant.components.homekit_controller
|
# homeassistant.components.homekit_controller
|
||||||
homekit==0.12.2
|
homekit[IP]==0.13.0
|
||||||
|
|
||||||
# homeassistant.components.homematicip_cloud
|
# homeassistant.components.homematicip_cloud
|
||||||
homematicip==0.10.6
|
homematicip==0.10.6
|
||||||
|
@ -69,7 +69,7 @@ TEST_REQUIREMENTS = (
|
|||||||
'hdate',
|
'hdate',
|
||||||
'holidays',
|
'holidays',
|
||||||
'home-assistant-frontend',
|
'home-assistant-frontend',
|
||||||
'homekit',
|
'homekit[IP]',
|
||||||
'homematicip',
|
'homematicip',
|
||||||
'influxdb',
|
'influxdb',
|
||||||
'jsonpath',
|
'jsonpath',
|
||||||
@ -106,7 +106,7 @@ TEST_REQUIREMENTS = (
|
|||||||
'python-forecastio',
|
'python-forecastio',
|
||||||
'python-nest',
|
'python-nest',
|
||||||
'python_awair',
|
'python_awair',
|
||||||
'pytradfri\\[async\\]',
|
'pytradfri[async]',
|
||||||
'pyunifi',
|
'pyunifi',
|
||||||
'pyupnp-async',
|
'pyupnp-async',
|
||||||
'pywebpush',
|
'pywebpush',
|
||||||
@ -291,7 +291,7 @@ def requirements_test_output(reqs):
|
|||||||
output.append('\n')
|
output.append('\n')
|
||||||
filtered = {key: value for key, value in reqs.items()
|
filtered = {key: value for key, value in reqs.items()
|
||||||
if any(
|
if any(
|
||||||
re.search(r'(^|#){}($|[=><])'.format(ign),
|
re.search(r'(^|#){}($|[=><])'.format(re.escape(ign)),
|
||||||
key) is not None for ign in TEST_REQUIREMENTS)}
|
key) is not None for ign in TEST_REQUIREMENTS)}
|
||||||
output.append(generate_requirements_list(filtered))
|
output.append(generate_requirements_list(filtered))
|
||||||
|
|
||||||
|
@ -471,7 +471,9 @@ async def test_import_works(hass):
|
|||||||
flow = config_flow.HomekitControllerFlowHandler()
|
flow = config_flow.HomekitControllerFlowHandler()
|
||||||
flow.hass = hass
|
flow.hass = hass
|
||||||
|
|
||||||
with mock.patch('homekit.controller.Pairing') as pairing_cls:
|
pairing_cls_imp = "homekit.controller.ip_implementation.IpPairing"
|
||||||
|
|
||||||
|
with mock.patch(pairing_cls_imp) as pairing_cls:
|
||||||
pairing_cls.return_value = pairing
|
pairing_cls.return_value = pairing
|
||||||
result = await flow.async_import_legacy_pairing(
|
result = await flow.async_import_legacy_pairing(
|
||||||
discovery_info['properties'], import_info)
|
discovery_info['properties'], import_info)
|
||||||
@ -649,7 +651,9 @@ async def test_parse_new_homekit_json(hass):
|
|||||||
flow = config_flow.HomekitControllerFlowHandler()
|
flow = config_flow.HomekitControllerFlowHandler()
|
||||||
flow.hass = hass
|
flow.hass = hass
|
||||||
|
|
||||||
with mock.patch('homekit.controller.Pairing') as pairing_cls:
|
pairing_cls_imp = "homekit.controller.ip_implementation.IpPairing"
|
||||||
|
|
||||||
|
with mock.patch(pairing_cls_imp) as pairing_cls:
|
||||||
pairing_cls.return_value = pairing
|
pairing_cls.return_value = pairing
|
||||||
with mock.patch('builtins.open', mock_open):
|
with mock.patch('builtins.open', mock_open):
|
||||||
with mock.patch('os.path', mock_path):
|
with mock.patch('os.path', mock_path):
|
||||||
@ -703,7 +707,9 @@ async def test_parse_old_homekit_json(hass):
|
|||||||
flow = config_flow.HomekitControllerFlowHandler()
|
flow = config_flow.HomekitControllerFlowHandler()
|
||||||
flow.hass = hass
|
flow.hass = hass
|
||||||
|
|
||||||
with mock.patch('homekit.controller.Pairing') as pairing_cls:
|
pairing_cls_imp = "homekit.controller.ip_implementation.IpPairing"
|
||||||
|
|
||||||
|
with mock.patch(pairing_cls_imp) as pairing_cls:
|
||||||
pairing_cls.return_value = pairing
|
pairing_cls.return_value = pairing
|
||||||
with mock.patch('builtins.open', mock_open):
|
with mock.patch('builtins.open', mock_open):
|
||||||
with mock.patch('os.path', mock_path):
|
with mock.patch('os.path', mock_path):
|
||||||
@ -769,7 +775,9 @@ async def test_parse_overlapping_homekit_json(hass):
|
|||||||
flow = config_flow.HomekitControllerFlowHandler()
|
flow = config_flow.HomekitControllerFlowHandler()
|
||||||
flow.hass = hass
|
flow.hass = hass
|
||||||
|
|
||||||
with mock.patch('homekit.controller.Pairing') as pairing_cls:
|
pairing_cls_imp = "homekit.controller.ip_implementation.IpPairing"
|
||||||
|
|
||||||
|
with mock.patch(pairing_cls_imp) as pairing_cls:
|
||||||
pairing_cls.return_value = pairing
|
pairing_cls.return_value = pairing
|
||||||
with mock.patch('builtins.open', side_effect=side_effects):
|
with mock.patch('builtins.open', side_effect=side_effects):
|
||||||
with mock.patch('os.path', mock_path):
|
with mock.patch('os.path', mock_path):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user