Handle incorrect values reported by some Shelly devices (#55042)
This commit is contained in:
parent
43b8353566
commit
fd66120d6d
2 changed files with 6 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
"""Binary sensor for Shelly."""
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Final
|
||||
from typing import Final, cast
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
DEVICE_CLASS_CONNECTIVITY,
|
||||
|
@ -46,7 +46,9 @@ SENSORS: Final = {
|
|||
name="Overpowering", device_class=DEVICE_CLASS_PROBLEM
|
||||
),
|
||||
("sensor", "dwIsOpened"): BlockAttributeDescription(
|
||||
name="Door", device_class=DEVICE_CLASS_OPENING
|
||||
name="Door",
|
||||
device_class=DEVICE_CLASS_OPENING,
|
||||
available=lambda block: cast(bool, block.dwIsOpened != -1),
|
||||
),
|
||||
("sensor", "flood"): BlockAttributeDescription(
|
||||
name="Flood", device_class=DEVICE_CLASS_MOISTURE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue