mirror of
https://github.com/Andre0512/hon.git
synced 2025-05-13 06:34:22 -04:00
Add first fridge sensors #41
This commit is contained in:
parent
0afbfe997d
commit
146e710881
32 changed files with 730 additions and 75 deletions
|
@ -4,11 +4,13 @@ import re
|
|||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent))
|
||||
|
||||
from custom_components.hon.binary_sensor import BINARY_SENSORS
|
||||
from custom_components.hon.button import BUTTONS
|
||||
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
|
||||
|
@ -41,6 +43,7 @@ entities = {
|
|||
"select": SELECTS,
|
||||
"sensor": SENSORS,
|
||||
"switch": SWITCHES,
|
||||
"climate": CLIMATES,
|
||||
}
|
||||
|
||||
result = {}
|
||||
|
@ -55,7 +58,11 @@ for entity_type, appliances in entities.items():
|
|||
else:
|
||||
key = entity.key
|
||||
attributes = (key, entity.name, entity.icon, entity_type)
|
||||
category = "control" if entity_type in ["switch", "button"] else "sensor"
|
||||
category = (
|
||||
"control"
|
||||
if entity_type in ["switch", "button", "climate"]
|
||||
else "sensor"
|
||||
)
|
||||
result.setdefault(appliance, {}).setdefault(
|
||||
entity.entity_category or category, []
|
||||
).append(attributes)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue