mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Update wolf_smartset to 0.1.6 (#40668)
* Bump wolf_smartset version. Support not fully fetched data * Fix black and pylint errors Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Remove dot from exception message. Co-authored-by: Chris Talkington <chris@talkingtontech.com> Co-authored-by: springstan <46536646+springstan@users.noreply.github.com> Co-authored-by: Chris Talkington <chris@talkingtontech.com>
This commit is contained in:
parent
52b745b8a9
commit
ef751c0961
@ -2,7 +2,7 @@
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
from httpcore import ConnectError
|
||||
from httpcore import ConnectError, ConnectTimeout
|
||||
from wolf_smartset.token_auth import InvalidAuth
|
||||
from wolf_smartset.wolf_client import WolfClient
|
||||
|
||||
@ -99,7 +99,7 @@ async def fetch_parameters(client: WolfClient, gateway_id: int, device_id: int):
|
||||
try:
|
||||
fetched_parameters = await client.fetch_parameters(gateway_id, device_id)
|
||||
return [param for param in fetched_parameters if param.name != "Reglertyp"]
|
||||
except ConnectError as exception:
|
||||
except (ConnectError, ConnectTimeout) as exception:
|
||||
raise UpdateFailed(f"Error communicating with API: {exception}") from exception
|
||||
except InvalidAuth as exception:
|
||||
raise UpdateFailed("Invalid authentication during update.") from exception
|
||||
raise UpdateFailed("Invalid authentication during update") from exception
|
||||
|
@ -3,6 +3,6 @@
|
||||
"name": "Wolf SmartSet Service",
|
||||
"config_flow": true,
|
||||
"documentation": "https://www.home-assistant.io/integrations/wolflink",
|
||||
"requirements": ["wolf_smartset==0.1.4"],
|
||||
"requirements": ["wolf_smartset==0.1.6"],
|
||||
"codeowners": ["@adamkrol93"]
|
||||
}
|
||||
|
@ -11,13 +11,6 @@ from wolf_smartset.models import (
|
||||
Temperature,
|
||||
)
|
||||
|
||||
from homeassistant.components.wolflink.const import (
|
||||
COORDINATOR,
|
||||
DEVICE_ID,
|
||||
DOMAIN,
|
||||
PARAMETERS,
|
||||
STATES,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
DEVICE_CLASS_PRESSURE,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
@ -27,6 +20,8 @@ from homeassistant.const import (
|
||||
)
|
||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
|
||||
from .const import COORDINATOR, DEVICE_ID, DOMAIN, PARAMETERS, STATES
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@ -63,6 +58,7 @@ class WolfLinkSensor(CoordinatorEntity):
|
||||
super().__init__(coordinator)
|
||||
self.wolf_object = wolf_object
|
||||
self.device_id = device_id
|
||||
self._state = None
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
@ -71,8 +67,10 @@ class WolfLinkSensor(CoordinatorEntity):
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
"""Return the state."""
|
||||
return self.coordinator.data[self.wolf_object.value_id]
|
||||
"""Return the state. Wolf Client is returning only changed values so we need to store old value here."""
|
||||
if self.wolf_object.value_id in self.coordinator.data:
|
||||
self._state = self.coordinator.data[self.wolf_object.value_id]
|
||||
return self._state
|
||||
|
||||
@property
|
||||
def device_state_attributes(self):
|
||||
@ -151,7 +149,7 @@ class WolfLinkState(WolfLinkSensor):
|
||||
@property
|
||||
def state(self):
|
||||
"""Return the state converting with supported values."""
|
||||
state = self.coordinator.data[self.wolf_object.value_id]
|
||||
state = super().state
|
||||
resolved_state = [
|
||||
item for item in self.wolf_object.items if item.value == int(state)
|
||||
]
|
||||
|
@ -2262,7 +2262,7 @@ withings-api==2.1.6
|
||||
wled==0.4.4
|
||||
|
||||
# homeassistant.components.wolflink
|
||||
wolf_smartset==0.1.4
|
||||
wolf_smartset==0.1.6
|
||||
|
||||
# homeassistant.components.xbee
|
||||
xbee-helper==0.0.7
|
||||
|
@ -1055,7 +1055,7 @@ withings-api==2.1.6
|
||||
wled==0.4.4
|
||||
|
||||
# homeassistant.components.wolflink
|
||||
wolf_smartset==0.1.4
|
||||
wolf_smartset==0.1.6
|
||||
|
||||
# homeassistant.components.bluesound
|
||||
# homeassistant.components.rest
|
||||
|
Loading…
x
Reference in New Issue
Block a user