Fix missing property in bosch_shc (#87260)

pull/87331/head
epenet 2023-02-03 18:41:47 +01:00 committed by GitHub
parent efb8cb8c90
commit cd99cdbc7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -3,13 +3,16 @@ from __future__ import annotations
from boschshcpy import SHCDevice, SHCIntrusionSystem
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import async_get as get_dev_reg
from homeassistant.helpers.entity import DeviceInfo, Entity
from .const import DOMAIN
async def async_remove_devices(hass, entity, entry_id) -> None:
async def async_remove_devices(
hass: HomeAssistant, entity: SHCBaseEntity, entry_id: str
) -> None:
"""Get item that is removed from session."""
dev_registry = get_dev_reg(hass)
device = dev_registry.async_get_device(
@ -49,6 +52,11 @@ class SHCBaseEntity(Entity):
await super().async_will_remove_from_hass()
self._device.unsubscribe_callback(self.entity_id)
@property
def device_id(self) -> str:
"""Return the device id."""
return self._device.id
class SHCEntity(SHCBaseEntity):
"""Representation of a SHC device entity."""