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:
Matthias Alphart 2021-06-09 14:08:29 +02:00 committed by GitHub
parent d3a4e21cb5
commit 6e20edc30c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 6 deletions

View File

@ -5,6 +5,8 @@ from typing import Callable
from xknx import XKNX
from xknx.devices import DateTime, ExposeSensor
from xknx.dpt import DPTNumeric
from xknx.remote_value import RemoteValueSensor
from homeassistant.const import (
CONF_ENTITY_ID,
@ -122,9 +124,15 @@ class KNXExposeSensor:
)
if self.type == "binary":
if value in (1, STATE_ON, "True"):
value = True
elif value in (0, STATE_OFF, "False"):
value = False
return True
if value in (0, STATE_OFF, "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
async def _async_entity_changed(self, event: Event) -> None:

View File

@ -2,7 +2,7 @@
"domain": "knx",
"name": "KNX",
"documentation": "https://www.home-assistant.io/integrations/knx",
"requirements": ["xknx==0.18.4"],
"requirements": ["xknx==0.18.5"],
"codeowners": ["@Julius2342", "@farmio", "@marvin-w"],
"quality_scale": "silver",
"iot_class": "local_push"

View File

@ -2377,7 +2377,7 @@ xbox-webapi==2.0.11
xboxapi==2.0.1
# homeassistant.components.knx
xknx==0.18.4
xknx==0.18.5
# homeassistant.components.bluesound
# homeassistant.components.rest

View File

@ -1286,7 +1286,7 @@ wolf_smartset==0.1.8
xbox-webapi==2.0.11
# homeassistant.components.knx
xknx==0.18.4
xknx==0.18.5
# homeassistant.components.bluesound
# homeassistant.components.rest