Update demetriek to v1.1.0 (#133064)
parent
1205178702
commit
b8ce1b010f
|
@ -13,7 +13,7 @@
|
|||
"integration_type": "device",
|
||||
"iot_class": "local_polling",
|
||||
"loggers": ["demetriek"],
|
||||
"requirements": ["demetriek==1.0.0"],
|
||||
"requirements": ["demetriek==1.1.0"],
|
||||
"ssdp": [
|
||||
{
|
||||
"deviceType": "urn:schemas-upnp-org:device:LaMetric:1"
|
||||
|
|
|
@ -25,6 +25,7 @@ class LaMetricNumberEntityDescription(NumberEntityDescription):
|
|||
"""Class describing LaMetric number entities."""
|
||||
|
||||
value_fn: Callable[[Device], int | None]
|
||||
has_fn: Callable[[Device], bool] = lambda device: True
|
||||
set_value_fn: Callable[[LaMetricDevice, float], Awaitable[Any]]
|
||||
|
||||
|
||||
|
@ -49,7 +50,8 @@ NUMBERS = [
|
|||
native_step=1,
|
||||
native_min_value=0,
|
||||
native_max_value=100,
|
||||
value_fn=lambda device: device.audio.volume,
|
||||
has_fn=lambda device: bool(device.audio),
|
||||
value_fn=lambda device: device.audio.volume if device.audio else 0,
|
||||
set_value_fn=lambda api, volume: api.audio(volume=int(volume)),
|
||||
),
|
||||
]
|
||||
|
|
|
@ -25,6 +25,7 @@ class LaMetricSwitchEntityDescription(SwitchEntityDescription):
|
|||
"""Class describing LaMetric switch entities."""
|
||||
|
||||
available_fn: Callable[[Device], bool] = lambda device: True
|
||||
has_fn: Callable[[Device], bool] = lambda device: True
|
||||
is_on_fn: Callable[[Device], bool]
|
||||
set_fn: Callable[[LaMetricDevice, bool], Awaitable[Any]]
|
||||
|
||||
|
@ -34,8 +35,11 @@ SWITCHES = [
|
|||
key="bluetooth",
|
||||
translation_key="bluetooth",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
available_fn=lambda device: device.bluetooth.available,
|
||||
is_on_fn=lambda device: device.bluetooth.active,
|
||||
available_fn=lambda device: bool(
|
||||
device.bluetooth and device.bluetooth.available
|
||||
),
|
||||
has_fn=lambda device: bool(device.bluetooth),
|
||||
is_on_fn=lambda device: bool(device.bluetooth and device.bluetooth.active),
|
||||
set_fn=lambda api, active: api.bluetooth(active=active),
|
||||
),
|
||||
]
|
||||
|
@ -54,6 +58,7 @@ async def async_setup_entry(
|
|||
description=description,
|
||||
)
|
||||
for description in SWITCHES
|
||||
if description.has_fn(coordinator.data)
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -747,7 +747,7 @@ defusedxml==0.7.1
|
|||
deluge-client==1.10.2
|
||||
|
||||
# homeassistant.components.lametric
|
||||
demetriek==1.0.0
|
||||
demetriek==1.1.0
|
||||
|
||||
# homeassistant.components.denonavr
|
||||
denonavr==1.0.1
|
||||
|
|
|
@ -637,7 +637,7 @@ defusedxml==0.7.1
|
|||
deluge-client==1.10.2
|
||||
|
||||
# homeassistant.components.lametric
|
||||
demetriek==1.0.0
|
||||
demetriek==1.1.0
|
||||
|
||||
# homeassistant.components.denonavr
|
||||
denonavr==1.0.1
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
'brightness_mode': 'auto',
|
||||
'display_type': 'mixed',
|
||||
'height': 8,
|
||||
'on': None,
|
||||
'screensaver': dict({
|
||||
'enabled': False,
|
||||
}),
|
||||
|
|
Loading…
Reference in New Issue