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