mirror of
https://github.com/sususweet/midea-meiju-codec.git
synced 2025-12-17 09:55:51 +00:00
feat: add support for colmo ground warmer, sn 17497071. Fix #54.
This commit is contained in:
@@ -108,13 +108,23 @@ class MideaClimateEntity(MideaEntity, ClimateEntity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def current_temperature(self):
|
def current_temperature(self):
|
||||||
temp = self._get_nested_value(self._key_current_temperature)
|
if isinstance(self._key_current_temperature, list):
|
||||||
if temp is not None:
|
temp_int = self._get_nested_value(self._key_current_temperature[0])
|
||||||
try:
|
tem_dec = self._get_nested_value(self._key_current_temperature[1])
|
||||||
return float(temp)
|
if temp_int is not None and tem_dec is not None:
|
||||||
except (ValueError, TypeError):
|
try:
|
||||||
return None
|
return float(temp_int) + float(tem_dec)
|
||||||
return None
|
except (ValueError, TypeError):
|
||||||
|
return None
|
||||||
|
return None
|
||||||
|
else:
|
||||||
|
temp = self._get_nested_value(self._key_current_temperature)
|
||||||
|
if temp is not None:
|
||||||
|
try:
|
||||||
|
return float(temp)
|
||||||
|
except (ValueError, TypeError):
|
||||||
|
return None
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def target_temperature(self):
|
def target_temperature(self):
|
||||||
|
|||||||
@@ -130,6 +130,69 @@ DEVICE_MAPPING = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"17497071": {
|
||||||
|
"rationale": ["off", "on"],
|
||||||
|
"queries": [{}, {"query_type": "water_model_run_status"}],
|
||||||
|
"centralized": [],
|
||||||
|
"entities": {
|
||||||
|
Platform.CLIMATE: {
|
||||||
|
"thermostat": {
|
||||||
|
"power": "water_model_power",
|
||||||
|
"hvac_modes": {
|
||||||
|
"off": {"water_model_power": "off"},
|
||||||
|
"heat": {"water_model_power": "on"},
|
||||||
|
},
|
||||||
|
"preset_modes": {
|
||||||
|
"auto": {"water_model_temperature_auto": "on", "water_temp_linkage_switch": 0},
|
||||||
|
"link": {"water_model_temperature_auto": "off", "water_temp_linkage_switch": 1},
|
||||||
|
"manual": {"water_model_temperature_auto": "off", "water_temp_linkage_switch": 0}
|
||||||
|
},
|
||||||
|
"target_temperature": "water_model_temperature_set",
|
||||||
|
"current_temperature": ["temperature", "small_temperature"],
|
||||||
|
"pre_mode": "mode",
|
||||||
|
"aux_heat": "water_model_ptc",
|
||||||
|
"min_temp": 25,
|
||||||
|
"max_temp": 60,
|
||||||
|
"temperature_unit": UnitOfTemperature.CELSIUS,
|
||||||
|
"precision": PRECISION_HALVES,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Platform.SWITCH: {
|
||||||
|
"water_model_power_save": {
|
||||||
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
|
},
|
||||||
|
"water_model_go_out": {
|
||||||
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
|
},
|
||||||
|
"water_model_ptc": {
|
||||||
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
|
"translation_key": "aux_heat",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Platform.SENSOR: {
|
||||||
|
"tw1_in_water_temp": {
|
||||||
|
"device_class": SensorDeviceClass.TEMPERATURE,
|
||||||
|
"unit_of_measurement": UnitOfTemperature.CELSIUS,
|
||||||
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
|
},
|
||||||
|
"tw1_out_water_temp": {
|
||||||
|
"device_class": SensorDeviceClass.TEMPERATURE,
|
||||||
|
"unit_of_measurement": UnitOfTemperature.CELSIUS,
|
||||||
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
|
},
|
||||||
|
"temperature": {
|
||||||
|
"device_class": SensorDeviceClass.TEMPERATURE,
|
||||||
|
"unit_of_measurement": UnitOfTemperature.CELSIUS,
|
||||||
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
|
},
|
||||||
|
"humidity": {
|
||||||
|
"device_class": SensorDeviceClass.HUMIDITY,
|
||||||
|
"unit_of_measurement": "%",
|
||||||
|
"state_class": SensorStateClass.MEASUREMENT
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"22259015": {
|
"22259015": {
|
||||||
"rationale": ["off", "on"],
|
"rationale": ["off", "on"],
|
||||||
"queries": [{}, {"query_type": "run_status"}, {"query_type": "module_30"}, {"query_type": "module_31"}, {"query_type": "module_32"}],
|
"queries": [{}, {"query_type": "run_status"}, {"query_type": "module_30"}, {"query_type": "module_31"}, {"query_type": "module_32"}],
|
||||||
|
|||||||
@@ -320,6 +320,13 @@
|
|||||||
"thermostat": {
|
"thermostat": {
|
||||||
"name": "Thermostat",
|
"name": "Thermostat",
|
||||||
"state_attributes": {
|
"state_attributes": {
|
||||||
|
"preset_modes": {
|
||||||
|
"state": {
|
||||||
|
"auto": "auto",
|
||||||
|
"link": "link",
|
||||||
|
"manual": "manual"
|
||||||
|
}
|
||||||
|
},
|
||||||
"fan_mode": {
|
"fan_mode": {
|
||||||
"state": {
|
"state": {
|
||||||
"silent": "Silent",
|
"silent": "Silent",
|
||||||
@@ -1565,6 +1572,12 @@
|
|||||||
},
|
},
|
||||||
"heat_temp_set": {
|
"heat_temp_set": {
|
||||||
"name": "Heat Temperature Set"
|
"name": "Heat Temperature Set"
|
||||||
|
},
|
||||||
|
"tw1_in_water_temp": {
|
||||||
|
"name": "Inlet Water Temperature"
|
||||||
|
},
|
||||||
|
"tw1_out_water_temp": {
|
||||||
|
"name": "Outlet Water Temperature"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"light": {
|
"light": {
|
||||||
@@ -2530,6 +2543,12 @@
|
|||||||
},
|
},
|
||||||
"work_switch": {
|
"work_switch": {
|
||||||
"name": "Work Switch"
|
"name": "Work Switch"
|
||||||
|
},
|
||||||
|
"water_model_power_save": {
|
||||||
|
"name": "Power Save Mode"
|
||||||
|
},
|
||||||
|
"water_model_go_out": {
|
||||||
|
"name": "Away Mode"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -320,6 +320,13 @@
|
|||||||
"thermostat": {
|
"thermostat": {
|
||||||
"name": "温控器",
|
"name": "温控器",
|
||||||
"state_attributes": {
|
"state_attributes": {
|
||||||
|
"preset_modes": {
|
||||||
|
"state": {
|
||||||
|
"auto": "自动",
|
||||||
|
"link": "联动",
|
||||||
|
"manual": "手动"
|
||||||
|
}
|
||||||
|
},
|
||||||
"fan_mode": {
|
"fan_mode": {
|
||||||
"state": {
|
"state": {
|
||||||
"silent": "静音",
|
"silent": "静音",
|
||||||
@@ -1569,6 +1576,12 @@
|
|||||||
},
|
},
|
||||||
"heat_temp_set": {
|
"heat_temp_set": {
|
||||||
"name": "制热设定温度"
|
"name": "制热设定温度"
|
||||||
|
},
|
||||||
|
"tw1_in_water_temp": {
|
||||||
|
"name": "进水温度"
|
||||||
|
},
|
||||||
|
"tw1_out_water_temp": {
|
||||||
|
"name": "出水温度"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"light": {
|
"light": {
|
||||||
@@ -2534,6 +2547,12 @@
|
|||||||
},
|
},
|
||||||
"work_switch": {
|
"work_switch": {
|
||||||
"name": "工作开关"
|
"name": "工作开关"
|
||||||
|
},
|
||||||
|
"water_model_power_save": {
|
||||||
|
"name": "节能模式"
|
||||||
|
},
|
||||||
|
"water_model_go_out": {
|
||||||
|
"name": "外出模式"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user