mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +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
|
from datetime import timedelta
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from httpcore import ConnectError
|
from httpcore import ConnectError, ConnectTimeout
|
||||||
from wolf_smartset.token_auth import InvalidAuth
|
from wolf_smartset.token_auth import InvalidAuth
|
||||||
from wolf_smartset.wolf_client import WolfClient
|
from wolf_smartset.wolf_client import WolfClient
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ async def fetch_parameters(client: WolfClient, gateway_id: int, device_id: int):
|
|||||||
try:
|
try:
|
||||||
fetched_parameters = await client.fetch_parameters(gateway_id, device_id)
|
fetched_parameters = await client.fetch_parameters(gateway_id, device_id)
|
||||||
return [param for param in fetched_parameters if param.name != "Reglertyp"]
|
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
|
raise UpdateFailed(f"Error communicating with API: {exception}") from exception
|
||||||
except InvalidAuth as 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",
|
"name": "Wolf SmartSet Service",
|
||||||
"config_flow": true,
|
"config_flow": true,
|
||||||
"documentation": "https://www.home-assistant.io/integrations/wolflink",
|
"documentation": "https://www.home-assistant.io/integrations/wolflink",
|
||||||
"requirements": ["wolf_smartset==0.1.4"],
|
"requirements": ["wolf_smartset==0.1.6"],
|
||||||
"codeowners": ["@adamkrol93"]
|
"codeowners": ["@adamkrol93"]
|
||||||
}
|
}
|
||||||
|
@ -11,13 +11,6 @@ from wolf_smartset.models import (
|
|||||||
Temperature,
|
Temperature,
|
||||||
)
|
)
|
||||||
|
|
||||||
from homeassistant.components.wolflink.const import (
|
|
||||||
COORDINATOR,
|
|
||||||
DEVICE_ID,
|
|
||||||
DOMAIN,
|
|
||||||
PARAMETERS,
|
|
||||||
STATES,
|
|
||||||
)
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
DEVICE_CLASS_PRESSURE,
|
DEVICE_CLASS_PRESSURE,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
DEVICE_CLASS_TEMPERATURE,
|
||||||
@ -27,6 +20,8 @@ from homeassistant.const import (
|
|||||||
)
|
)
|
||||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||||
|
|
||||||
|
from .const import COORDINATOR, DEVICE_ID, DOMAIN, PARAMETERS, STATES
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
@ -63,6 +58,7 @@ class WolfLinkSensor(CoordinatorEntity):
|
|||||||
super().__init__(coordinator)
|
super().__init__(coordinator)
|
||||||
self.wolf_object = wolf_object
|
self.wolf_object = wolf_object
|
||||||
self.device_id = device_id
|
self.device_id = device_id
|
||||||
|
self._state = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -71,8 +67,10 @@ class WolfLinkSensor(CoordinatorEntity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
"""Return the state."""
|
"""Return the state. Wolf Client is returning only changed values so we need to store old value here."""
|
||||||
return self.coordinator.data[self.wolf_object.value_id]
|
if self.wolf_object.value_id in self.coordinator.data:
|
||||||
|
self._state = self.coordinator.data[self.wolf_object.value_id]
|
||||||
|
return self._state
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
@ -151,7 +149,7 @@ class WolfLinkState(WolfLinkSensor):
|
|||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
"""Return the state converting with supported values."""
|
"""Return the state converting with supported values."""
|
||||||
state = self.coordinator.data[self.wolf_object.value_id]
|
state = super().state
|
||||||
resolved_state = [
|
resolved_state = [
|
||||||
item for item in self.wolf_object.items if item.value == int(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
|
wled==0.4.4
|
||||||
|
|
||||||
# homeassistant.components.wolflink
|
# homeassistant.components.wolflink
|
||||||
wolf_smartset==0.1.4
|
wolf_smartset==0.1.6
|
||||||
|
|
||||||
# homeassistant.components.xbee
|
# homeassistant.components.xbee
|
||||||
xbee-helper==0.0.7
|
xbee-helper==0.0.7
|
||||||
|
@ -1055,7 +1055,7 @@ withings-api==2.1.6
|
|||||||
wled==0.4.4
|
wled==0.4.4
|
||||||
|
|
||||||
# homeassistant.components.wolflink
|
# homeassistant.components.wolflink
|
||||||
wolf_smartset==0.1.4
|
wolf_smartset==0.1.6
|
||||||
|
|
||||||
# homeassistant.components.bluesound
|
# homeassistant.components.bluesound
|
||||||
# homeassistant.components.rest
|
# homeassistant.components.rest
|
||||||
|
Loading…
x
Reference in New Issue
Block a user