diff --git a/homeassistant/components/zha/core/channels/security.py b/homeassistant/components/zha/core/channels/security.py index 19be861178f..0e1e0f8e8a3 100644 --- a/homeassistant/components/zha/core/channels/security.py +++ b/homeassistant/components/zha/core/channels/security.py @@ -84,7 +84,7 @@ class IasAce(ZigbeeChannel): @callback def cluster_command(self, tsn, command_id, args) -> None: """Handle commands received to this cluster.""" - self.warning( + self.debug( "received command %s", self._cluster.server_commands[command_id].name ) self.command_map[command_id](*args) @@ -120,7 +120,7 @@ class IasAce(ZigbeeChannel): code != self.panel_code and self.armed_state != AceCluster.PanelStatus.Panel_Disarmed ): - self.warning("Invalid code supplied to IAS ACE") + self.debug("Invalid code supplied to IAS ACE") self.invalid_tries += 1 zigbee_reply = self.arm_response( AceCluster.ArmNotification.Invalid_Arm_Disarm_Code @@ -131,12 +131,12 @@ class IasAce(ZigbeeChannel): self.armed_state == AceCluster.PanelStatus.Panel_Disarmed and self.alarm_status == AceCluster.AlarmStatus.No_Alarm ): - self.warning("IAS ACE already disarmed") + self.debug("IAS ACE already disarmed") zigbee_reply = self.arm_response( AceCluster.ArmNotification.Already_Disarmed ) else: - self.warning("Disarming all IAS ACE zones") + self.debug("Disarming all IAS ACE zones") zigbee_reply = self.arm_response( AceCluster.ArmNotification.All_Zones_Disarmed ) @@ -177,12 +177,12 @@ class IasAce(ZigbeeChannel): ) -> None: """Arm the panel with the specified statuses.""" if self.code_required_arm_actions and code != self.panel_code: - self.warning("Invalid code supplied to IAS ACE") + self.debug("Invalid code supplied to IAS ACE") zigbee_reply = self.arm_response( AceCluster.ArmNotification.Invalid_Arm_Disarm_Code ) else: - self.warning("Arming all IAS ACE zones") + self.debug("Arming all IAS ACE zones") self.armed_state = panel_status zigbee_reply = self.arm_response(armed_type) return zigbee_reply diff --git a/homeassistant/components/zha/core/gateway.py b/homeassistant/components/zha/core/gateway.py index 1280f3defe3..0ba375362f7 100644 --- a/homeassistant/components/zha/core/gateway.py +++ b/homeassistant/components/zha/core/gateway.py @@ -240,14 +240,14 @@ class ZHAGateway: async def async_initialize_devices_and_entities(self) -> None: """Initialize devices and load entities.""" - _LOGGER.warning("Loading all devices") + _LOGGER.debug("Loading all devices") await asyncio.gather( *(dev.async_initialize(from_cache=True) for dev in self.devices.values()) ) async def fetch_updated_state() -> None: """Fetch updated state for mains powered devices.""" - _LOGGER.warning("Fetching current state for mains powered devices") + _LOGGER.debug("Fetching current state for mains powered devices") await asyncio.gather( *( dev.async_initialize(from_cache=False) diff --git a/homeassistant/components/zha/entity.py b/homeassistant/components/zha/entity.py index 50ffb8f4fcd..e9ea9ee871a 100644 --- a/homeassistant/components/zha/entity.py +++ b/homeassistant/components/zha/entity.py @@ -206,10 +206,8 @@ class ZhaEntity(BaseZhaEntity, RestoreEntity): signal_override=True, ) - if not self.zha_device.is_mains_powered: - # mains powered devices will get real time state - if last_state := await self.async_get_last_state(): - self.async_restore_last_state(last_state) + if last_state := await self.async_get_last_state(): + self.async_restore_last_state(last_state) self.async_accept_signal( None, diff --git a/homeassistant/components/zha/select.py b/homeassistant/components/zha/select.py index b9237e24eef..afa2ee18da9 100644 --- a/homeassistant/components/zha/select.py +++ b/homeassistant/components/zha/select.py @@ -86,12 +86,6 @@ class ZHAEnumSelectEntity(ZhaEntity, SelectEntity): self._channel.data_cache[self._attr_name] = self._enum[option.replace(" ", "_")] self.async_write_ha_state() - async def async_added_to_hass(self) -> None: - """Run when about to be added to hass.""" - await super().async_added_to_hass() - if last_state := await self.async_get_last_state(): - self.async_restore_last_state(last_state) - @callback def async_restore_last_state(self, last_state) -> None: """Restore previous state."""