Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #316 from Thomas55555/add-availability-property-to…
Browse files Browse the repository at this point in the history
…-park_for-and-mow_for

Add availability property to park for and mow for
  • Loading branch information
Thomas55555 authored Jul 18, 2022
2 parents e6e3c54 + 3ee3745 commit f6cc9bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/husqvarna_automower/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ def __init__(self, session, idx, description: NumberEntityDescription):
self._attr_name = f"{self.mower_name} {description.name}"
self._attr_unique_id = f"{self.mower_id}_{description.key}"

@property
def available(self) -> bool:
"""Return True if the device is available."""
available = self.get_mower_attributes()["metadata"]["connected"]
return available

async def async_set_native_value(self, value: float) -> None:
"""Change the value."""
command_type = "actions"
Expand Down

0 comments on commit f6cc9bc

Please sign in to comment.