Black
This commit is contained in:
1 parent
da05dfe708
commit
4de97abc3a
2676 files changed
+163166
-140084
No files matched your search
@@ -20,7 +20,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
async def async_setup_entry(
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities
|
||||
hass: HomeAssistantType, entry: ConfigEntry, async_add_entities
|
||||
) -> None:
|
||||
"""Set up a Toon binary sensor based on a config entry."""
|
||||
toon = hass.data[DATA_TOON][entry.entry_id]
|
||||
@@ -28,29 +28,29 @@ async def async_setup_entry(
|
||||
sensors = [
|
||||
ToonBoilerModuleBinarySensor(
|
||||
toon,
|
||||
'thermostat_info',
|
||||
'boiler_connected',
|
||||
"thermostat_info",
|
||||
"boiler_connected",
|
||||
None,
|
||||
'Boiler Module Connection',
|
||||
'mdi:check-network-outline',
|
||||
'connectivity',
|
||||
"Boiler Module Connection",
|
||||
"mdi:check-network-outline",
|
||||
"connectivity",
|
||||
),
|
||||
ToonDisplayBinarySensor(
|
||||
toon,
|
||||
'thermostat_info',
|
||||
'active_state',
|
||||
"thermostat_info",
|
||||
"active_state",
|
||||
4,
|
||||
"Toon Holiday Mode",
|
||||
'mdi:airport',
|
||||
"mdi:airport",
|
||||
None,
|
||||
),
|
||||
ToonDisplayBinarySensor(
|
||||
toon,
|
||||
'thermostat_info',
|
||||
'next_program',
|
||||
"thermostat_info",
|
||||
"next_program",
|
||||
None,
|
||||
"Toon Program",
|
||||
'mdi:calendar-clock',
|
||||
"mdi:calendar-clock",
|
||||
None,
|
||||
),
|
||||
]
|
||||
@@ -60,48 +60,48 @@ async def async_setup_entry(
|
||||
[
|
||||
ToonBoilerBinarySensor(
|
||||
toon,
|
||||
'thermostat_info',
|
||||
'ot_communication_error',
|
||||
'0',
|
||||
"thermostat_info",
|
||||
"ot_communication_error",
|
||||
"0",
|
||||
"OpenTherm Connection",
|
||||
'mdi:check-network-outline',
|
||||
'connectivity',
|
||||
"mdi:check-network-outline",
|
||||
"connectivity",
|
||||
),
|
||||
ToonBoilerBinarySensor(
|
||||
toon,
|
||||
'thermostat_info',
|
||||
'error_found',
|
||||
"thermostat_info",
|
||||
"error_found",
|
||||
255,
|
||||
"Boiler Status",
|
||||
'mdi:alert',
|
||||
'problem',
|
||||
"mdi:alert",
|
||||
"problem",
|
||||
inverted=True,
|
||||
),
|
||||
ToonBoilerBinarySensor(
|
||||
toon,
|
||||
'thermostat_info',
|
||||
'burner_info',
|
||||
"thermostat_info",
|
||||
"burner_info",
|
||||
None,
|
||||
"Boiler Burner",
|
||||
'mdi:fire',
|
||||
"mdi:fire",
|
||||
None,
|
||||
),
|
||||
ToonBoilerBinarySensor(
|
||||
toon,
|
||||
'thermostat_info',
|
||||
'burner_info',
|
||||
'2',
|
||||
"thermostat_info",
|
||||
"burner_info",
|
||||
"2",
|
||||
"Hot Tap Water",
|
||||
'mdi:water-pump',
|
||||
"mdi:water-pump",
|
||||
None,
|
||||
),
|
||||
ToonBoilerBinarySensor(
|
||||
toon,
|
||||
'thermostat_info',
|
||||
'burner_info',
|
||||
'3',
|
||||
"thermostat_info",
|
||||
"burner_info",
|
||||
"3",
|
||||
"Boiler Preheating",
|
||||
'mdi:fire',
|
||||
"mdi:fire",
|
||||
None,
|
||||
),
|
||||
]
|
||||
@@ -114,15 +114,15 @@ class ToonBinarySensor(ToonEntity, BinarySensorDevice):
|
||||
"""Defines an Toon binary sensor."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
toon: ToonData,
|
||||
section: str,
|
||||
measurement: str,
|
||||
on_value: Any,
|
||||
name: str,
|
||||
icon: str,
|
||||
device_class: str,
|
||||
inverted: bool = False,
|
||||
self,
|
||||
toon: ToonData,
|
||||
section: str,
|
||||
measurement: str,
|
||||
on_value: Any,
|
||||
name: str,
|
||||
icon: str,
|
||||
device_class: str,
|
||||
inverted: bool = False,
|
||||
) -> None:
|
||||
"""Initialize the Toon sensor."""
|
||||
self._state = inverted
|
||||
@@ -137,11 +137,11 @@ class ToonBinarySensor(ToonEntity, BinarySensorDevice):
|
||||
@property
|
||||
def unique_id(self) -> str:
|
||||
"""Return the unique ID for this binary sensor."""
|
||||
return '_'.join(
|
||||
return "_".join(
|
||||
[
|
||||
DOMAIN,
|
||||
self.toon.agreement.id,
|
||||
'binary_sensor',
|
||||
"binary_sensor",
|
||||
self.section,
|
||||
self.measurement,
|
||||
str(self.on_value),
|
||||
@@ -186,9 +186,7 @@ class ToonDisplayBinarySensor(ToonBinarySensor, ToonDisplayDeviceEntity):
|
||||
pass
|
||||
|
||||
|
||||
class ToonBoilerModuleBinarySensor(
|
||||
ToonBinarySensor, ToonBoilerModuleDeviceEntity
|
||||
):
|
||||
class ToonBoilerModuleBinarySensor(ToonBinarySensor, ToonBoilerModuleDeviceEntity):
|
||||
"""Defines a Boiler module binary sensor."""
|
||||
|
||||
pass
|
||||
Reference in new issue
Block a user