Skip to content
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
17 changes: 15 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,20 @@ 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:
return False

if status_state := self.device.states.get(OverkizState.CORE_STATUS):
Comment on lines +50 to +54
return (
status_state.value == OverkizCommandParam.AVAILABLE
and super().available
)
Comment thread
balloob marked this conversation as resolved.

return False
Comment on lines +47 to +60

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