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

Handle where thermostat is offline #109

Merged
merged 2 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion custom_components/starling_home_hub/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

NAME = "Starling Home Hub Integration"
DOMAIN = "starling_home_hub"
VERSION = "1.1.0"
VERSION = "1.1.1"
ATTRIBUTION = "Based on the Starling Home Hub Developer Connect API"

CONF_ENABLE_RTSP_STREAM = "enable_rtsp_stream"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/starling_home_hub/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
self.async_write_ha_state()

def get_device(self) -> Device:
def get_device(self) -> Device | None:
"""Get the actual device data from coordinator."""
return self.coordinator.data.devices.get(self.device_id)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def __init__(
@property
def available(self) -> bool:
"""Return device availability."""
return self.get_device().properties["isOnline"]
device = self.get_device()
return device is not None and device.properties["isOnline"]

@property
def current_temperature(self) -> float | None:
Expand Down
2 changes: 1 addition & 1 deletion custom_components/starling_home_hub/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"documentation": "https://github.com/ThomasLomas/ha-starlinghomehub",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/ThomasLomas/ha-starlinghomehub/issues",
"version": "1.1.0"
"version": "1.1.1"
}
Loading