Add first fridge sensors #41
This commit is contained in:
		@@ -36,6 +36,7 @@ PROGRAMS = {
 | 
			
		||||
        "programs_ov": "PROGRAMS.OV",
 | 
			
		||||
        "programs_td": "PROGRAMS.TD",
 | 
			
		||||
        "programs_wm": "PROGRAMS.WM_WD",
 | 
			
		||||
        "programs_ref": "PROGRAMS.REF",
 | 
			
		||||
    },
 | 
			
		||||
    "sensor": {
 | 
			
		||||
        "programs_td": "PROGRAMS.TD",
 | 
			
		||||
@@ -134,6 +135,8 @@ NAMES = {
 | 
			
		||||
        "det_liquid": "HUBS.WIDGET.STAINS_WIDGET.STAINS.SUGGESTED_DET_LIQUID",
 | 
			
		||||
        "errors": "ROBOT_CMD&CTRL.PHASE_ERROR.TITLE",
 | 
			
		||||
        "programs": "OV.TABS.CURRENT_PROGRAM",
 | 
			
		||||
        "room_temperature": "REF.SMART_DRINK_ASSISTANT.AMBIENT",
 | 
			
		||||
        "humidity": "AP.TITLES.HUMIDITY",
 | 
			
		||||
        "cycles_total": [
 | 
			
		||||
            "WASHING_CMD&CTRL.GENERAL.CYCLES",
 | 
			
		||||
            "WC.VIRTUAL_WINE_STATS_COUNTRY.TOTAL",
 | 
			
		||||
@@ -167,6 +170,7 @@ NAMES = {
 | 
			
		||||
        "dry_time": "WASHING_CMD&CTRL.DRAWER_CYCLE_DRYING.TAB_TIME",
 | 
			
		||||
        "steam_level": "WASHING_CMD&CTRL.PROGRAM_CYCLE_DETAIL_MAIN_OPTIONS.STEAM_LEVEL",
 | 
			
		||||
    },
 | 
			
		||||
    "climate": {"air_conditioner": "GLOBALS.APPLIANCES_NAME.AC"},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user