diff --git a/CHANGELOG.md b/CHANGELOG.md index 70190ae..231e125 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.0.10 + +- Update core to latest + ## 2.0.9 - Update core features diff --git a/custom_components/shinobi/core/components/camera.py b/custom_components/shinobi/core/components/camera.py index cbc3b62..fa5bc3b 100644 --- a/custom_components/shinobi/core/components/camera.py +++ b/custom_components/shinobi/core/components/camera.py @@ -26,7 +26,7 @@ class CoreCamera(Camera, BaseEntity, ABC): - """ Shinobi Video Camera """ + """ Camera """ def __init__(self, hass, device_info): super().__init__() diff --git a/custom_components/shinobi/core/components/select.py b/custom_components/shinobi/core/components/select.py index 7977672..fffb7d3 100644 --- a/custom_components/shinobi/core/components/select.py +++ b/custom_components/shinobi/core/components/select.py @@ -18,7 +18,7 @@ class CoreSelect(SelectEntity, BaseEntity, ABC): - """ Shinobi Video Monitor Mode Control """ + """ Core Select """ def initialize( self, hass: HomeAssistant, @@ -43,7 +43,7 @@ def current_option(self) -> str: return str(self.entity.state) async def async_select_option(self, option: str) -> None: - """Select monitor mode.""" + """Select option.""" await self.ha.async_core_entity_select_option(self.entity, option) @staticmethod diff --git a/custom_components/shinobi/core/components/sensor.py b/custom_components/shinobi/core/components/sensor.py index 8649204..e520702 100644 --- a/custom_components/shinobi/core/components/sensor.py +++ b/custom_components/shinobi/core/components/sensor.py @@ -7,7 +7,7 @@ class CoreSensor(SensorEntity, BaseEntity): - """Representation a binary sensor that is updated by EdgeOS.""" + """Representation a binary sensor.""" @property def native_value(self): diff --git a/custom_components/shinobi/core/components/switch.py b/custom_components/shinobi/core/components/switch.py index 0269ece..dd6d4d7 100644 --- a/custom_components/shinobi/core/components/switch.py +++ b/custom_components/shinobi/core/components/switch.py @@ -14,7 +14,7 @@ class CoreSwitch(SwitchEntity, BaseEntity): - """Class for a Shinobi Video switch.""" + """Class for a switch.""" @property def is_on(self) -> bool | None: diff --git a/custom_components/shinobi/core/components/vacuum.py b/custom_components/shinobi/core/components/vacuum.py index 9021101..5080031 100644 --- a/custom_components/shinobi/core/components/vacuum.py +++ b/custom_components/shinobi/core/components/vacuum.py @@ -16,7 +16,7 @@ class CoreVacuum(StateVacuumEntity, BaseEntity, ABC): - """Class for a Shinobi Video switch.""" + """Class for a switch.""" def initialize( self, diff --git a/custom_components/shinobi/core/managers/entity_manager.py b/custom_components/shinobi/core/managers/entity_manager.py index acce23a..280ddd8 100644 --- a/custom_components/shinobi/core/managers/entity_manager.py +++ b/custom_components/shinobi/core/managers/entity_manager.py @@ -157,8 +157,6 @@ async def _async_delete_components(self): ) async def _async_update(self): - _LOGGER.debug("Starting to update entities") - try: await self._async_add_components() await self._async_delete_components() @@ -241,14 +239,17 @@ def set_entity(self, entity = self.entities.get(entity_description.key) + original_status = None + if entity is None: - entity = EntityData(entry_id, entity_description) + entity = EntityData(entry_id) entity.status = EntityStatus.CREATED entity.domain = domain self._compare_data(entity, state, attributes, device_name) else: + original_status = entity.status was_modified = self._compare_data(entity, state, attributes, device_name, entity_description, details) if was_modified: @@ -259,6 +260,7 @@ def set_entity(self, entity.attributes = attributes entity.device_name = device_name entity.details = details + entity.entity_description = entity_description if destructors is not None and True in destructors: if entity.status == EntityStatus.CREATED: @@ -274,4 +276,4 @@ def set_entity(self, self.entities[entity_description.key] = entity if entity.status != EntityStatus.READY: - _LOGGER.info(f"{entity.name} ({entity.domain}) {entity.status}, state: {entity.state}") + _LOGGER.info(f"{entity.name} ({entity.domain}) {entity.status}, state: {entity.state} | {original_status}") diff --git a/custom_components/shinobi/core/models/domain_data.py b/custom_components/shinobi/core/models/domain_data.py index b152ec1..54755d9 100644 --- a/custom_components/shinobi/core/models/domain_data.py +++ b/custom_components/shinobi/core/models/domain_data.py @@ -3,6 +3,7 @@ import logging from typing import Any, Callable +from homeassistant.const import CONF_NAME from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback diff --git a/custom_components/shinobi/core/models/entity_data.py b/custom_components/shinobi/core/models/entity_data.py index a383fe4..c785ee4 100644 --- a/custom_components/shinobi/core/models/entity_data.py +++ b/custom_components/shinobi/core/models/entity_data.py @@ -18,11 +18,11 @@ class EntityData: disabled: bool domain: str | None entry_id: str - entity_description: EntityDescription + entity_description: EntityDescription | None - def __init__(self, entry_id: str, entity_description: EntityDescription): + def __init__(self, entry_id: str): self.entry_id = entry_id - self.entity_description = entity_description + self.entity_description = None self.state = None self.attributes = {} self.details = {} diff --git a/custom_components/shinobi/manifest.json b/custom_components/shinobi/manifest.json index 92a320d..331d889 100644 --- a/custom_components/shinobi/manifest.json +++ b/custom_components/shinobi/manifest.json @@ -8,6 +8,6 @@ "codeowners": ["@elad-bar"], "requirements": [ ], "config_flow": true, - "version": "2.0.9", + "version": "2.0.10", "iot_class": "local_polling" }