Skip to content

Commit

Permalink
Merge pull request #31 from hasscc/main
Browse files Browse the repository at this point in the history
Sync Tests with Fixes
  • Loading branch information
milosljubenovic authored Sep 4, 2024
2 parents ac61c32 + cce851f commit 9dda352
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions custom_components/catlink/modules/scooper_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def __init__(
maxlen=self.additional_config.max_samples_litter or 24
)
self._error_logs = deque(maxlen=20)
self.additional_config = additional_config
self.empty_litter_box_weight = self.additional_config.empty_weight or 0.0

async def async_init(self) -> None:
Expand Down Expand Up @@ -177,20 +176,14 @@ def online(self) -> bool:
return False

@property
def temperature(self):
try:
return float(self.detail.get("temperature", 0))
except Exception as exc:
_LOGGER.error("Get temperature failed: %s", exc)
return 0
def temperature(self) -> str:
"""Return the temperature."""
return self.detail.get("temperature", "-")

@property
def humidity(self):
try:
return float(self.detail.get("humidity", 0))
except Exception as exc:
_LOGGER.error("Get humidity failed: %s", exc)
return 0
def humidity(self) -> str:
"""Return the humidity."""
return self.detail.get("humidity", "-")

@property
def error(self) -> str:
Expand Down

0 comments on commit 9dda352

Please sign in to comment.