mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Bump automower-ble to 0.2.0 (#129473)
This commit is contained in:
parent
16f5e76f00
commit
8151403bf6
@ -75,19 +75,19 @@ class HusqvarnaCoordinator(DataUpdateCoordinator[dict[str, bytes]]):
|
||||
|
||||
try:
|
||||
data["battery_level"] = await self.mower.battery_level()
|
||||
LOGGER.debug(data["battery_level"])
|
||||
LOGGER.debug("battery_level" + str(data["battery_level"]))
|
||||
if data["battery_level"] is None:
|
||||
await self._async_find_device()
|
||||
raise UpdateFailed("Error getting data from device")
|
||||
|
||||
data["activity"] = await self.mower.mower_activity()
|
||||
LOGGER.debug(data["activity"])
|
||||
LOGGER.debug("activity:" + str(data["activity"]))
|
||||
if data["activity"] is None:
|
||||
await self._async_find_device()
|
||||
raise UpdateFailed("Error getting data from device")
|
||||
|
||||
data["state"] = await self.mower.mower_state()
|
||||
LOGGER.debug(data["state"])
|
||||
LOGGER.debug("state:" + str(data["state"]))
|
||||
if data["state"] is None:
|
||||
await self._async_find_device()
|
||||
raise UpdateFailed("Error getting data from device")
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from automower_ble.protocol import MowerActivity, MowerState
|
||||
|
||||
from homeassistant.components import bluetooth
|
||||
from homeassistant.components.lawn_mower import (
|
||||
LawnMowerActivity,
|
||||
@ -60,29 +62,31 @@ class AutomowerLawnMower(HusqvarnaAutomowerBleEntity, LawnMowerEntity):
|
||||
if self.coordinator.data is None:
|
||||
return None
|
||||
|
||||
state = str(self.coordinator.data["state"])
|
||||
activity = str(self.coordinator.data["activity"])
|
||||
state = self.coordinator.data["state"]
|
||||
activity = self.coordinator.data["activity"]
|
||||
|
||||
if state is None or activity is None:
|
||||
return None
|
||||
|
||||
if state == "paused":
|
||||
if state == MowerState.PAUSED:
|
||||
return LawnMowerActivity.PAUSED
|
||||
if state in ("stopped", "off", "waitForSafetyPin"):
|
||||
if state in (MowerState.STOPPED, MowerState.OFF, MowerState.WAIT_FOR_SAFETYPIN):
|
||||
# This is actually stopped, but that isn't an option
|
||||
return LawnMowerActivity.ERROR
|
||||
if state in (
|
||||
"restricted",
|
||||
"inOperation",
|
||||
"unknown",
|
||||
"checkSafety",
|
||||
"pendingStart",
|
||||
MowerState.RESTRICTED,
|
||||
MowerState.IN_OPERATION,
|
||||
MowerState.PENDING_START,
|
||||
):
|
||||
if activity in ("charging", "parked", "none"):
|
||||
if activity in (
|
||||
MowerActivity.CHARGING,
|
||||
MowerActivity.PARKED,
|
||||
MowerActivity.NONE,
|
||||
):
|
||||
return LawnMowerActivity.DOCKED
|
||||
if activity in ("goingOut", "mowing"):
|
||||
if activity in (MowerActivity.GOING_OUT, MowerActivity.MOWING):
|
||||
return LawnMowerActivity.MOWING
|
||||
if activity in ("goingHome"):
|
||||
if activity == MowerActivity.GOING_HOME:
|
||||
return LawnMowerActivity.RETURNING
|
||||
return LawnMowerActivity.ERROR
|
||||
|
||||
|
@ -12,5 +12,5 @@
|
||||
"dependencies": ["bluetooth_adapters"],
|
||||
"documentation": "https://www.home-assistant.io/integrations/???",
|
||||
"iot_class": "local_polling",
|
||||
"requirements": ["automower-ble==0.1.35"]
|
||||
"requirements": ["automower-ble==0.2.0"]
|
||||
}
|
||||
|
@ -524,7 +524,7 @@ aurorapy==0.2.7
|
||||
autarco==3.0.0
|
||||
|
||||
# homeassistant.components.husqvarna_automower_ble
|
||||
automower-ble==0.1.35
|
||||
automower-ble==0.2.0
|
||||
|
||||
# homeassistant.components.avea
|
||||
# avea==1.5.1
|
||||
|
@ -479,7 +479,7 @@ aurorapy==0.2.7
|
||||
autarco==3.0.0
|
||||
|
||||
# homeassistant.components.husqvarna_automower_ble
|
||||
automower-ble==0.1.35
|
||||
automower-ble==0.2.0
|
||||
|
||||
# homeassistant.components.axis
|
||||
axis==63
|
||||
|
Loading…
x
Reference in New Issue
Block a user