mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Update xknx to version 0.18.5 (#51644)
* xknx 0.18.5 * fix integer DPTs trying to cast str state with `int()` * Delint Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
d3a4e21cb5
commit
6e20edc30c
@ -5,6 +5,8 @@ from typing import Callable
|
|||||||
|
|
||||||
from xknx import XKNX
|
from xknx import XKNX
|
||||||
from xknx.devices import DateTime, ExposeSensor
|
from xknx.devices import DateTime, ExposeSensor
|
||||||
|
from xknx.dpt import DPTNumeric
|
||||||
|
from xknx.remote_value import RemoteValueSensor
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_ENTITY_ID,
|
CONF_ENTITY_ID,
|
||||||
@ -122,9 +124,15 @@ class KNXExposeSensor:
|
|||||||
)
|
)
|
||||||
if self.type == "binary":
|
if self.type == "binary":
|
||||||
if value in (1, STATE_ON, "True"):
|
if value in (1, STATE_ON, "True"):
|
||||||
value = True
|
return True
|
||||||
elif value in (0, STATE_OFF, "False"):
|
if value in (0, STATE_OFF, "False"):
|
||||||
value = False
|
return False
|
||||||
|
if (
|
||||||
|
value is not None
|
||||||
|
and isinstance(self.device.sensor_value, RemoteValueSensor)
|
||||||
|
and issubclass(self.device.sensor_value.dpt_class, DPTNumeric)
|
||||||
|
):
|
||||||
|
return float(value)
|
||||||
return value
|
return value
|
||||||
|
|
||||||
async def _async_entity_changed(self, event: Event) -> None:
|
async def _async_entity_changed(self, event: Event) -> None:
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"domain": "knx",
|
"domain": "knx",
|
||||||
"name": "KNX",
|
"name": "KNX",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/knx",
|
"documentation": "https://www.home-assistant.io/integrations/knx",
|
||||||
"requirements": ["xknx==0.18.4"],
|
"requirements": ["xknx==0.18.5"],
|
||||||
"codeowners": ["@Julius2342", "@farmio", "@marvin-w"],
|
"codeowners": ["@Julius2342", "@farmio", "@marvin-w"],
|
||||||
"quality_scale": "silver",
|
"quality_scale": "silver",
|
||||||
"iot_class": "local_push"
|
"iot_class": "local_push"
|
||||||
|
@ -2377,7 +2377,7 @@ xbox-webapi==2.0.11
|
|||||||
xboxapi==2.0.1
|
xboxapi==2.0.1
|
||||||
|
|
||||||
# homeassistant.components.knx
|
# homeassistant.components.knx
|
||||||
xknx==0.18.4
|
xknx==0.18.5
|
||||||
|
|
||||||
# homeassistant.components.bluesound
|
# homeassistant.components.bluesound
|
||||||
# homeassistant.components.rest
|
# homeassistant.components.rest
|
||||||
|
@ -1286,7 +1286,7 @@ wolf_smartset==0.1.8
|
|||||||
xbox-webapi==2.0.11
|
xbox-webapi==2.0.11
|
||||||
|
|
||||||
# homeassistant.components.knx
|
# homeassistant.components.knx
|
||||||
xknx==0.18.4
|
xknx==0.18.5
|
||||||
|
|
||||||
# homeassistant.components.bluesound
|
# homeassistant.components.bluesound
|
||||||
# homeassistant.components.rest
|
# homeassistant.components.rest
|
||||||
|
Loading…
x
Reference in New Issue
Block a user