diff --git a/homeassistant/components/govee_ble/manifest.json b/homeassistant/components/govee_ble/manifest.json index 624a38ebe9d..2ba97b95d08 100644 --- a/homeassistant/components/govee_ble/manifest.json +++ b/homeassistant/components/govee_ble/manifest.json @@ -15,6 +15,10 @@ "manufacturer_id": 18994, "service_uuid": "00008551-0000-1000-8000-00805f9b34fb" }, + { + "manufacturer_id": 818, + "service_uuid": "00008551-0000-1000-8000-00805f9b34fb" + }, { "manufacturer_id": 14474, "service_uuid": "00008151-0000-1000-8000-00805f9b34fb" @@ -24,7 +28,7 @@ "service_uuid": "00008251-0000-1000-8000-00805f9b34fb" } ], - "requirements": ["govee-ble==0.12.6"], + "requirements": ["govee-ble==0.14.0"], "dependencies": ["bluetooth"], "codeowners": ["@bdraco"], "iot_class": "local_push" diff --git a/homeassistant/components/homekit_controller/manifest.json b/homeassistant/components/homekit_controller/manifest.json index 5f6b3f92220..cf3069e3b0d 100644 --- a/homeassistant/components/homekit_controller/manifest.json +++ b/homeassistant/components/homekit_controller/manifest.json @@ -3,7 +3,7 @@ "name": "HomeKit Controller", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/homekit_controller", - "requirements": ["aiohomekit==1.2.5"], + "requirements": ["aiohomekit==1.2.8"], "zeroconf": ["_hap._tcp.local.", "_hap._udp.local."], "bluetooth": [{ "manufacturer_id": 76, "manufacturer_data_start": [6] }], "dependencies": ["bluetooth", "zeroconf"], diff --git a/homeassistant/components/icloud/account.py b/homeassistant/components/icloud/account.py index 4dc3c07aba7..d0e3b8059a4 100644 --- a/homeassistant/components/icloud/account.py +++ b/homeassistant/components/icloud/account.py @@ -17,7 +17,7 @@ from pyicloud.services.findmyiphone import AppleDevice from homeassistant.components.zone import async_active_zone from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntry from homeassistant.const import ATTR_ATTRIBUTION, CONF_USERNAME -from homeassistant.core import HomeAssistant +from homeassistant.core import CALLBACK_TYPE, HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers.dispatcher import dispatcher_send from homeassistant.helpers.event import track_point_in_utc_time @@ -104,6 +104,8 @@ class IcloudAccount: self._retried_fetch = False self._config_entry = config_entry + self.listeners: list[CALLBACK_TYPE] = [] + def setup(self) -> None: """Set up an iCloud account.""" try: diff --git a/homeassistant/components/icloud/device_tracker.py b/homeassistant/components/icloud/device_tracker.py index 9c2004f0edb..4a63486ae8d 100644 --- a/homeassistant/components/icloud/device_tracker.py +++ b/homeassistant/components/icloud/device_tracker.py @@ -35,7 +35,7 @@ async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback ) -> None: """Set up device tracker for iCloud component.""" - account = hass.data[DOMAIN][entry.unique_id] + account: IcloudAccount = hass.data[DOMAIN][entry.unique_id] tracked = set[str]() @callback diff --git a/homeassistant/components/icloud/sensor.py b/homeassistant/components/icloud/sensor.py index 6e415aa3350..3feb30f078f 100644 --- a/homeassistant/components/icloud/sensor.py +++ b/homeassistant/components/icloud/sensor.py @@ -20,7 +20,7 @@ async def async_setup_entry( hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback ) -> None: """Set up device tracker for iCloud component.""" - account = hass.data[DOMAIN][entry.unique_id] + account: IcloudAccount = hass.data[DOMAIN][entry.unique_id] tracked = set[str]() @callback diff --git a/homeassistant/components/inkbird/manifest.json b/homeassistant/components/inkbird/manifest.json index 686c9bada2d..b0ef08143c2 100644 --- a/homeassistant/components/inkbird/manifest.json +++ b/homeassistant/components/inkbird/manifest.json @@ -7,9 +7,10 @@ { "local_name": "sps" }, { "local_name": "Inkbird*" }, { "local_name": "iBBQ*" }, + { "local_name": "xBBQ*" }, { "local_name": "tps" } ], - "requirements": ["inkbird-ble==0.5.1"], + "requirements": ["inkbird-ble==0.5.2"], "dependencies": ["bluetooth"], "codeowners": ["@bdraco"], "iot_class": "local_push" diff --git a/homeassistant/components/notion/__init__.py b/homeassistant/components/notion/__init__.py index 2a73d12d946..eaa3f55e56c 100644 --- a/homeassistant/components/notion/__init__.py +++ b/homeassistant/components/notion/__init__.py @@ -3,6 +3,8 @@ from __future__ import annotations import asyncio from datetime import timedelta +import logging +import traceback from typing import Any from aionotion import async_get_client @@ -31,7 +33,6 @@ PLATFORMS = [Platform.BINARY_SENSOR, Platform.SENSOR] ATTR_SYSTEM_MODE = "system_mode" ATTR_SYSTEM_NAME = "system_name" -DEFAULT_ATTRIBUTION = "Data provided by Notion" DEFAULT_SCAN_INTERVAL = timedelta(minutes=1) CONFIG_SCHEMA = cv.removed(DOMAIN, raise_if_present=False) @@ -75,6 +76,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: f"There was a Notion error while updating {attr}: {result}" ) from result if isinstance(result, Exception): + if LOGGER.isEnabledFor(logging.DEBUG): + LOGGER.debug("".join(traceback.format_tb(result.__traceback__))) raise UpdateFailed( f"There was an unknown error while updating {attr}: {result}" ) from result diff --git a/homeassistant/components/rainmachine/__init__.py b/homeassistant/components/rainmachine/__init__.py index 3feeac7a827..07dbe63ca00 100644 --- a/homeassistant/components/rainmachine/__init__.py +++ b/homeassistant/components/rainmachine/__init__.py @@ -437,7 +437,7 @@ class RainMachineEntity(CoordinatorEntity): self.async_write_ha_state() async def async_added_to_hass(self) -> None: - """Handle entity which will be added.""" + """When entity is added to hass.""" await super().async_added_to_hass() self.update_from_latest_data() diff --git a/homeassistant/components/rainmachine/binary_sensor.py b/homeassistant/components/rainmachine/binary_sensor.py index 6ba374a28ba..80e3b90e577 100644 --- a/homeassistant/components/rainmachine/binary_sensor.py +++ b/homeassistant/components/rainmachine/binary_sensor.py @@ -77,7 +77,6 @@ BINARY_SENSOR_DESCRIPTIONS = ( name="Hourly restrictions", icon="mdi:cancel", entity_category=EntityCategory.DIAGNOSTIC, - entity_registry_enabled_default=False, api_category=DATA_RESTRICTIONS_CURRENT, data_key="hourly", ), @@ -86,7 +85,6 @@ BINARY_SENSOR_DESCRIPTIONS = ( name="Month restrictions", icon="mdi:cancel", entity_category=EntityCategory.DIAGNOSTIC, - entity_registry_enabled_default=False, api_category=DATA_RESTRICTIONS_CURRENT, data_key="month", ), @@ -95,7 +93,6 @@ BINARY_SENSOR_DESCRIPTIONS = ( name="Rain delay restrictions", icon="mdi:cancel", entity_category=EntityCategory.DIAGNOSTIC, - entity_registry_enabled_default=False, api_category=DATA_RESTRICTIONS_CURRENT, data_key="rainDelay", ), @@ -113,7 +110,6 @@ BINARY_SENSOR_DESCRIPTIONS = ( name="Weekday restrictions", icon="mdi:cancel", entity_category=EntityCategory.DIAGNOSTIC, - entity_registry_enabled_default=False, api_category=DATA_RESTRICTIONS_CURRENT, data_key="weekDay", ), diff --git a/homeassistant/components/sms/notify.py b/homeassistant/components/sms/notify.py index d076f3625ba..21b48946f55 100644 --- a/homeassistant/components/sms/notify.py +++ b/homeassistant/components/sms/notify.py @@ -20,31 +20,32 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend( def get_service(hass, config, discovery_info=None): """Get the SMS notification service.""" - if SMS_GATEWAY not in hass.data[DOMAIN]: - _LOGGER.error("SMS gateway not found, cannot initialize service") - return - - gateway = hass.data[DOMAIN][SMS_GATEWAY][GATEWAY] - if discovery_info is None: number = config[CONF_RECIPIENT] else: number = discovery_info[CONF_RECIPIENT] - return SMSNotificationService(gateway, number) + return SMSNotificationService(hass, number) class SMSNotificationService(BaseNotificationService): """Implement the notification service for SMS.""" - def __init__(self, gateway, number): + def __init__(self, hass, number): """Initialize the service.""" - self.gateway = gateway + + self.hass = hass self.number = number async def async_send_message(self, message="", **kwargs): """Send SMS message.""" + if SMS_GATEWAY not in self.hass.data[DOMAIN]: + _LOGGER.error("SMS gateway not found, cannot send message") + return + + gateway = self.hass.data[DOMAIN][SMS_GATEWAY][GATEWAY] + targets = kwargs.get(CONF_TARGET, [self.number]) smsinfo = { "Class": -1, @@ -67,6 +68,6 @@ class SMSNotificationService(BaseNotificationService): encoded_message["Number"] = target try: # Actually send the message - await self.gateway.send_sms_async(encoded_message) + await gateway.send_sms_async(encoded_message) except gammu.GSMError as exc: _LOGGER.error("Sending to %s failed: %s", target, exc) diff --git a/homeassistant/components/unifiprotect/manifest.json b/homeassistant/components/unifiprotect/manifest.json index 815b5250e1d..ad18be3dba9 100644 --- a/homeassistant/components/unifiprotect/manifest.json +++ b/homeassistant/components/unifiprotect/manifest.json @@ -3,7 +3,7 @@ "name": "UniFi Protect", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/unifiprotect", - "requirements": ["pyunifiprotect==4.0.11", "unifi-discovery==1.1.5"], + "requirements": ["pyunifiprotect==4.0.12", "unifi-discovery==1.1.5"], "dependencies": ["http"], "codeowners": ["@briis", "@AngellusMortis", "@bdraco"], "quality_scale": "platinum", diff --git a/homeassistant/const.py b/homeassistant/const.py index dda81cbdc5c..f877b3f34f5 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -7,7 +7,7 @@ from .backports.enum import StrEnum MAJOR_VERSION: Final = 2022 MINOR_VERSION: Final = 8 -PATCH_VERSION: Final = "2" +PATCH_VERSION: Final = "3" __short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}" __version__: Final = f"{__short_version__}.{PATCH_VERSION}" REQUIRED_PYTHON_VER: Final[tuple[int, int, int]] = (3, 9, 0) diff --git a/homeassistant/generated/bluetooth.py b/homeassistant/generated/bluetooth.py index ef8193dad28..15a822599c6 100644 --- a/homeassistant/generated/bluetooth.py +++ b/homeassistant/generated/bluetooth.py @@ -41,6 +41,11 @@ BLUETOOTH: list[dict[str, str | int | list[int]]] = [ "manufacturer_id": 18994, "service_uuid": "00008551-0000-1000-8000-00805f9b34fb" }, + { + "domain": "govee_ble", + "manufacturer_id": 818, + "service_uuid": "00008551-0000-1000-8000-00805f9b34fb" + }, { "domain": "govee_ble", "manufacturer_id": 14474, @@ -70,6 +75,10 @@ BLUETOOTH: list[dict[str, str | int | list[int]]] = [ "domain": "inkbird", "local_name": "iBBQ*" }, + { + "domain": "inkbird", + "local_name": "xBBQ*" + }, { "domain": "inkbird", "local_name": "tps" diff --git a/pyproject.toml b/pyproject.toml index 568607d6d0d..61f6b20af07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "homeassistant" -version = "2022.8.2" +version = "2022.8.3" license = {text = "Apache-2.0"} description = "Open-source home automation platform running on Python 3." readme = "README.rst" diff --git a/requirements_all.txt b/requirements_all.txt index 5bd396ea124..c5254b61842 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -168,7 +168,7 @@ aioguardian==2022.07.0 aioharmony==0.2.9 # homeassistant.components.homekit_controller -aiohomekit==1.2.5 +aiohomekit==1.2.8 # homeassistant.components.emulated_hue # homeassistant.components.http @@ -760,7 +760,7 @@ googlemaps==2.5.1 goslide-api==0.5.1 # homeassistant.components.govee_ble -govee-ble==0.12.6 +govee-ble==0.14.0 # homeassistant.components.remote_rpi_gpio gpiozero==1.6.2 @@ -902,7 +902,7 @@ influxdb-client==1.24.0 influxdb==5.3.1 # homeassistant.components.inkbird -inkbird-ble==0.5.1 +inkbird-ble==0.5.2 # homeassistant.components.insteon insteon-frontend-home-assistant==0.2.0 @@ -2003,7 +2003,7 @@ pytrafikverket==0.2.0.1 pyudev==0.23.2 # homeassistant.components.unifiprotect -pyunifiprotect==4.0.11 +pyunifiprotect==4.0.12 # homeassistant.components.uptimerobot pyuptimerobot==22.2.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 86b7dbb93e6..c64f4506850 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -152,7 +152,7 @@ aioguardian==2022.07.0 aioharmony==0.2.9 # homeassistant.components.homekit_controller -aiohomekit==1.2.5 +aiohomekit==1.2.8 # homeassistant.components.emulated_hue # homeassistant.components.http @@ -561,7 +561,7 @@ google-nest-sdm==2.0.0 googlemaps==2.5.1 # homeassistant.components.govee_ble -govee-ble==0.12.6 +govee-ble==0.14.0 # homeassistant.components.gree greeclimate==1.3.0 @@ -655,7 +655,7 @@ influxdb-client==1.24.0 influxdb==5.3.1 # homeassistant.components.inkbird -inkbird-ble==0.5.1 +inkbird-ble==0.5.2 # homeassistant.components.insteon insteon-frontend-home-assistant==0.2.0 @@ -1354,7 +1354,7 @@ pytrafikverket==0.2.0.1 pyudev==0.23.2 # homeassistant.components.unifiprotect -pyunifiprotect==4.0.11 +pyunifiprotect==4.0.12 # homeassistant.components.uptimerobot pyuptimerobot==22.2.0 diff --git a/tests/components/homekit_controller/fixtures/schlage_sense.json b/tests/components/homekit_controller/fixtures/schlage_sense.json new file mode 100644 index 00000000000..04e1923da55 --- /dev/null +++ b/tests/components/homekit_controller/fixtures/schlage_sense.json @@ -0,0 +1,356 @@ +[ + { + "aid": 1, + "services": [ + { + "iid": 1, + "type": "0000003E-0000-1000-8000-0026BB765291", + "characteristics": [ + { + "type": "00000020-0000-1000-8000-0026BB765291", + "iid": 4, + "perms": ["pr"], + "format": "string", + "value": "Schlage ", + "description": "Manufacturer", + "maxLen": 64 + }, + { + "type": "00000021-0000-1000-8000-0026BB765291", + "iid": 5, + "perms": ["pr"], + "format": "string", + "value": "BE479CAM619", + "description": "Model", + "maxLen": 64 + }, + { + "type": "00000023-0000-1000-8000-0026BB765291", + "iid": 6, + "perms": ["pr"], + "format": "string", + "value": "SENSE ", + "description": "Name", + "maxLen": 64 + }, + { + "type": "00000030-0000-1000-8000-0026BB765291", + "iid": 7, + "perms": ["pr"], + "format": "string", + "value": "AAAAAAA000", + "description": "Serial Number", + "maxLen": 64 + }, + { + "type": "00000014-0000-1000-8000-0026BB765291", + "iid": 3, + "perms": ["pw"], + "format": "bool", + "description": "Identify" + }, + { + "type": "00000052-0000-1000-8000-0026BB765291", + "iid": 8, + "perms": ["pr"], + "format": "string", + "value": "004.027.000", + "description": "Firmware Revision", + "maxLen": 64 + }, + { + "type": "00000053-0000-1000-8000-0026BB765291", + "iid": 51, + "perms": ["pr"], + "format": "string", + "value": "1.3.0", + "description": "Hardware Revision", + "maxLen": 64 + }, + { + "type": "00000054-0000-1000-8000-0026BB765291", + "iid": 50, + "perms": ["pr"], + "format": "string", + "value": "002.001.000", + "maxLen": 64 + } + ] + }, + { + "iid": 10, + "type": "7F0DEE73-4A3F-4103-98E6-A46CD301BDFB", + "characteristics": [ + { + "type": "44FF6853-58DB-4956-B298-5F6650DD61F6", + "iid": 25, + "perms": ["pw"], + "format": "data" + }, + { + "type": "CF68C40F-DC6F-4F7E-918C-4C536B643A2B", + "iid": 26, + "perms": ["pr", "pw"], + "format": "uint8", + "value": 0, + "minValue": 0, + "maxValue": 3, + "minStep": 1 + }, + { + "type": "4058C2B8-4545-4E77-B6B7-157C38F9718B", + "iid": 27, + "perms": ["pr", "pw"], + "format": "uint8", + "value": 0, + "minValue": 1, + "maxValue": 5, + "minStep": 1 + }, + { + "type": "B498F4B5-6364-4F79-B5CC-1563ADE070DF", + "iid": 28, + "perms": ["pr", "pw"], + "format": "uint8", + "value": 1, + "minValue": 0, + "maxValue": 1 + }, + { + "type": "AFAE7AD2-8DD3-4B20-BAE0-C0B18B79EDB5", + "iid": 29, + "perms": ["pw"], + "format": "data" + }, + { + "type": "87D91EC6-C508-4CAD-89F1-A21B0BF179A0", + "iid": 30, + "perms": ["pr"], + "format": "data", + "value": "000a00000000000000000000" + }, + { + "type": "4C3E2641-F57F-11E3-A3AC-0800200C9A66", + "iid": 31, + "perms": ["pr"], + "format": "uint64", + "value": 3468600224 + }, + { + "type": "EEC26990-F628-11E3-A3AC-0800200C9A66", + "iid": 32, + "perms": ["pr", "pw"], + "format": "uint8", + "value": 4, + "minValue": 4, + "maxValue": 8, + "minStep": 1 + }, + { + "type": "BCDE3B9E-3963-4123-B24D-42ECCBB3A9C4", + "iid": 33, + "perms": ["pr"], + "format": "data", + "value": "4e6f6e65" + }, + { + "type": "A9464D14-6806-4375-BA53-E14F7E0A6BEE", + "iid": 34, + "perms": ["pr", "pw"], + "format": null, + "value": "ff" + }, + { + "type": "00000023-0000-1000-8000-0026BB765291", + "iid": 35, + "perms": ["pr"], + "format": "string", + "value": "Additional Settings", + "description": "Name", + "maxLen": 64 + }, + { + "type": "63D23C2F-2FBB-45E8-8540-47CC26C517D0", + "iid": 36, + "perms": ["pr"], + "format": "uint8", + "value": 100 + } + ] + }, + { + "iid": 23, + "type": "00000044-0000-1000-8000-0026BB765291", + "characteristics": [ + { + "type": "00000019-0000-1000-8000-0026BB765291", + "iid": 16, + "perms": ["pw"], + "format": "data", + "description": "Lock Control Point" + }, + { + "type": "00000037-0000-1000-8000-0026BB765291", + "iid": 17, + "perms": ["pr"], + "format": "string", + "value": "02.00.00", + "description": "Version", + "maxLen": 64 + }, + { + "type": "0000001F-0000-1000-8000-0026BB765291", + "iid": 18, + "perms": ["pr"], + "format": "data", + "value": "012431443133423434392d423941312d334135392d463042412d3245393030304233453430450208000000000000000003010404030001ff", + "description": "Logs" + }, + { + "type": "00000005-0000-1000-8000-0026BB765291", + "iid": 19, + "perms": ["pr", "pw"], + "format": "bool", + "value": true, + "description": "Audio Feedback" + }, + { + "type": "0000001A-0000-1000-8000-0026BB765291", + "iid": 20, + "perms": ["pr", "pw"], + "format": "uint32", + "value": 0, + "description": "Lock Management Auto Security Timeout", + "unit": "seconds" + }, + { + "type": "00000001-0000-1000-8000-0026BB765291", + "iid": 21, + "perms": ["pr", "pw"], + "format": "bool", + "value": false, + "description": "Administrator Only Access" + } + ] + }, + { + "iid": 30, + "type": "00000045-0000-1000-8000-0026BB765291", + "characteristics": [ + { + "type": "0000001D-0000-1000-8000-0026BB765291", + "iid": 11, + "perms": ["pr", "ev"], + "format": "uint8", + "value": 3, + "description": "Lock Current State", + "minValue": 0, + "maxValue": 3, + "minStep": 1 + }, + { + "type": "0000001E-0000-1000-8000-0026BB765291", + "iid": 12, + "perms": ["pr", "pw", "ev"], + "format": "uint8", + "value": 1, + "description": "Lock Target State", + "minValue": 0, + "maxValue": 1, + "minStep": 1 + }, + { + "type": "00000023-0000-1000-8000-0026BB765291", + "iid": 13, + "perms": ["pr"], + "format": "string", + "value": "Lock Mechanism", + "description": "Name", + "maxLen": 64 + } + ] + }, + { + "iid": 34, + "type": "1F6B43AA-94DE-4BA9-981C-DA38823117BD", + "characteristics": [ + { + "type": "048D8799-695B-4A7F-A7F7-A4A1301587FE", + "iid": 39, + "perms": ["pw"], + "format": "data" + }, + { + "type": "66B7C7FD-95A7-4F89-B0AD-38073A67C46C", + "iid": 40, + "perms": ["pw"], + "format": "data" + }, + { + "type": "507EFC3F-9231-438C-976A-FA04427F1F8F", + "iid": 41, + "perms": ["pw"], + "format": "data" + }, + { + "type": "1DC15719-0882-4BAD-AB0F-9AEAB0600C90", + "iid": 42, + "perms": ["pr"], + "format": "data", + "value": "03" + } + ] + }, + { + "iid": 39, + "type": "00000055-0000-1000-8000-0026BB765291", + "characteristics": [ + { + "type": "0000004C-0000-1000-8000-0026BB765291", + "iid": 45, + "perms": [], + "format": "data", + "description": "Pair Setup" + }, + { + "type": "0000004E-0000-1000-8000-0026BB765291", + "iid": 46, + "perms": [], + "format": "data", + "description": "Pair Verify" + }, + { + "type": "0000004F-0000-1000-8000-0026BB765291", + "iid": 47, + "perms": [], + "format": "uint8", + "description": "Pairing Features" + }, + { + "type": "00000050-0000-1000-8000-0026BB765291", + "iid": 48, + "perms": ["pr", "pw"], + "format": "data", + "value": null, + "description": "Pairing Pairings" + } + ] + }, + { + "iid": 44, + "type": "000000A2-0000-1000-8000-0026BB765291", + "characteristics": [ + { + "type": "00000037-0000-1000-8000-0026BB765291", + "iid": 62, + "perms": ["pr"], + "format": "string", + "value": "02.00.00", + "description": "Version", + "maxLen": 64 + } + ] + } + ] + } +] diff --git a/tests/components/homekit_controller/specific_devices/test_schlage_sense.py b/tests/components/homekit_controller/specific_devices/test_schlage_sense.py new file mode 100644 index 00000000000..d572989e345 --- /dev/null +++ b/tests/components/homekit_controller/specific_devices/test_schlage_sense.py @@ -0,0 +1,40 @@ +"""Make sure that Schlage Sense is enumerated properly.""" + + +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_schlage_sense_setup(hass): + """Test that the accessory can be correctly setup in HA.""" + accessories = await setup_accessories_from_file(hass, "schlage_sense.json") + await setup_test_accessories(hass, accessories) + + await assert_devices_and_entities_created( + hass, + DeviceTestInfo( + unique_id=HUB_TEST_ACCESSORY_ID, + name="SENSE ", + model="BE479CAM619", + manufacturer="Schlage ", + sw_version="004.027.000", + hw_version="1.3.0", + serial_number="AAAAAAA000", + devices=[], + entities=[ + EntityTestInfo( + entity_id="lock.sense_lock_mechanism", + friendly_name="SENSE Lock Mechanism", + unique_id="homekit-AAAAAAA000-30", + supported_features=0, + state="unknown", + ), + ], + ), + )