Skip to content
Merged
Changes from 1 commit
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
15 changes: 13 additions & 2 deletions homeassistant/components/overkiz/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import cast

from pyoverkiz.enums import OverkizAttribute, OverkizState
from pyoverkiz.enums import APIType, OverkizAttribute, OverkizCommandParam, OverkizState
from pyoverkiz.models import Device

from homeassistant.helpers.device_registry import DeviceInfo
Expand Down Expand Up @@ -44,7 +44,18 @@ def __init__(
@property
def available(self) -> bool:
"""Return True if entity is available."""
return self.device.available and super().available
if self.device.available:
return super().available

# Workaround: local API may incorrectly report available=False (Somfy-TaHoma-Developer-Mode#217)
if self.coordinator.client.api_type == APIType.LOCAL:
if status_state := self.device.states.get(OverkizState.CORE_STATUS):
return (
status_state.value == OverkizCommandParam.AVAILABLE
and super().available
)

return False
Comment thread
balloob marked this conversation as resolved.
Outdated
Comment on lines +47 to +60

@property
def is_sub_device(self) -> bool:
Expand Down