mirror of
https://github.com/Andre0512/hon.git
synced 2025-05-13 06:34:22 -04:00
Add climate entites for fridge #41
This commit is contained in:
parent
a8762367ed
commit
cb660fa9e0
27 changed files with 706 additions and 38 deletions
|
@ -14,7 +14,11 @@ from custom_components.hon.climate import CLIMATES
|
|||
from custom_components.hon.number import NUMBERS
|
||||
from custom_components.hon.select import SELECTS
|
||||
from custom_components.hon.sensor import SENSORS
|
||||
from custom_components.hon.switch import SWITCHES, HonSwitchEntityDescription
|
||||
from custom_components.hon.switch import (
|
||||
SWITCHES,
|
||||
HonControlSwitchEntityDescription,
|
||||
HonSwitchEntityDescription,
|
||||
)
|
||||
|
||||
APPLIANCES = {
|
||||
"AC": "Air conditioner",
|
||||
|
@ -50,11 +54,7 @@ result = {}
|
|||
for entity_type, appliances in entities.items():
|
||||
for appliance, data in appliances.items():
|
||||
for entity in data:
|
||||
if (
|
||||
isinstance(entity, HonSwitchEntityDescription)
|
||||
and entity.entity_category != "config"
|
||||
and "settings." not in entity.key
|
||||
):
|
||||
if isinstance(entity, HonControlSwitchEntityDescription):
|
||||
key = f"{entity.turn_on_key}` / `{entity.turn_off_key}"
|
||||
else:
|
||||
key = entity.key
|
||||
|
@ -62,7 +62,8 @@ for entity_type, appliances in entities.items():
|
|||
category = (
|
||||
"control"
|
||||
if entity.key.startswith("settings")
|
||||
or hasattr(entity, "turn_on_key")
|
||||
or isinstance(entity, HonSwitchEntityDescription)
|
||||
or isinstance(entity, HonControlSwitchEntityDescription)
|
||||
or entity_type in ["button", "climate"]
|
||||
else "sensor"
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue