Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for 2022.3.3 #695

Merged
merged 1 commit into from
Mar 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions custom_components/xiaomi_gateway3/core/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import time
from typing import Any, Dict, List, Optional, Union, TYPE_CHECKING

from homeassistant.helpers.entity import EntityPlatformState

from . import converters
from .converters import Converter, LUMI_GLOBALS, GATEWAY, ZIGBEE, \
BLE, MESH, MESH_GROUP_MODEL
Expand Down Expand Up @@ -396,14 +398,14 @@ def update(self, value: dict):
if entity.subscribed_attrs & attrs:
entity.async_set_state(value)
# noinspection PyProtectedMember
if entity._added:
if entity._platform_state == EntityPlatformState.ADDED:
entity.async_write_ha_state()

def update_available(self):
for entity in self.entities.values():
entity.async_update_available()
# noinspection PyProtectedMember
if entity._added:
if entity._platform_state == EntityPlatformState.ADDED:
entity.async_write_ha_state()


Expand Down