banto6 / haier

海尔智能家居设备接入HomeAssistant
Apache License 2.0
470 stars 107 forks source link

water_heater实体增加支持空气能和电热水器 #125

Open staritbusfans opened 3 weeks ago

staritbusfans commented 3 weeks ago

为空气能热水器带来water_heater实体,在卡萨帝CU150A1上测试OK,注意本人无燃气热水器,无法测试代码是否破坏了燃气热水器部分。 附上设备json

 [{'desc': '查询所有属性', 'invisible': True, 'name': 'getAllProperty', 'operationType': 'I', 'readable': True, 'valueRange': {'dataList': [{'data': 'getAllProperty'}], 'type': 'LIST'}, 'writable': True}, {'defaultValue': '1', 'desc': '工作状态', 'invisible': False, 'name': 'workStatus', 'readable': True, 'value': '2', 'valueRange': {'dataList': [{'data': '1', 'desc': '保温'}, {'data': '2', 'desc': '加热'}], 'type': 'LIST'}, 'writable': False}, {'defaultValue': '0', 'desc': '速热模式最高设定温度', 'invisible': False, 'name': 'heatModeMaxTemp', 'readable': True, 'value': '0', 'valueRange': {'dataList': [{'data': '0', 'desc': '80℃'}, {'data': '1', 'desc': '75℃'}, {'data': '2', 'desc': '65℃'}, {'data': '3', 'desc': '55℃'}], 'type': 'LIST'}, 'writable': False}, {'defaultValue': 'false', 'desc': '预约2循环状态', 'invisible': False, 'name': 'resn2CycleStatus', 'operationType': 'G', 'readable': True, 'value': 'true', 'valueRange': {'dataList': [{'data': 'false', 'desc': '执行一次'}, {'data': 'true', 'desc': '循环'}], 'type': 'LIST'}, 'writable': True}, {'defaultValue': '0', 'desc': '当前温度', 'invisible': False, 'name': 'currentTemperature', 'readable': True, 'value': '30', 'valueRange': {'dataStep': {'dataType': 'Integer', 'maxValue': '100', 'minValue': '0', 'step': '1'}, 'type': 'STEP'}, 'writable': False}, {'defaultValue': '0', 'desc': '预约1时间小时', 'invisible': False, 'name': 'resn1TimeHH', 'operationType': 'G', 'readable': True, 'value': '5', 'valueRange': {'dataStep': {'dataType': 'Integer', 'maxValue': '23', 'minValue': '0', 'step': '1'}, 'type': 'STEP'}, 'writable': True}, {'defaultValue': '0', 'desc': '预约1时间分钟', 'invisible': False, 'name': 'resn1TimeMM', 'operationType': 'G', 'readable': True, 'value': '30', 'valueRange': {'dataStep': {'dataType': 'Integer', 'maxValue': '59', 'minValue': '0', 'step': '1'}, 'type': 'STEP'}, 'writable': True}, {'desc': '停止报警', 'invisible': True, 'name': 'stopCurrentAlarm', 'operationType': 'I', 'readable': True, 'valueRange': {'dataList': [{'data': 'stopCurrentAlarm'}], 'type': 'LIST'}, 'writable': True}, {'defaultValue': '0', 'desc': '预约2时间小时', 'invisible': False, 'name': 'resn2TimeHH', 'operationType': 'G', 'readable': True, 'value': '0', 'valueRange': {'dataStep': {'dataType': 'Integer', 'maxValue': '23', 'minValue': '0', 'step': '1'}, 'type': 'STEP'}, 'writable': True}, {'defaultValue': '0', 'desc': '预约2时间分钟', 'invisible': False, 'name': 'resn2TimeMM', 'operationType': 'G', 'readable': True, 'value': '0', 'valueRange': {'dataStep': {'dataType': 'Integer', 'maxValue': '59', 'minValue': '0', 'step': '1'}, 'type': 'STEP'}, 'writable': True}, {'defaultValue': '35', 'desc': '预约2温度', 'invisible': False, 'name': 'resn2Temperature', 'operationType': 'G', 'readable': True, 'value': '50', 'valueRange': {'dataStep': {'dataType': 'Integer', 'maxValue': '80', 'minValue': '35', 'step': '1'}, 'type': 'STEP'}, 'writable': True}, {'defaultValue': 'false', 'desc': '预约1启停', 'invisible': False, 'name': 'resn1RunningStatus', 'operationType': 'G', 'readable': True, 'value': 'false', 'valueRange': {'dataList': [{'data': 'false', 'desc': '停止预约'}, {'data': 'true', 'desc': '启用预约'}], 'type': 'LIST'}, 'writable': True}, {'defaultValue': 'false', 'desc': '预约2启停', 'invisible': False, 'name': 'resn2RunningStatus', 'operationType': 'G', 'readable': True, 'value': 'false', 'valueRange': {'dataList': [{'data': 'false', 'desc': '停止预约'}, {'data': 'true', 'desc': '启用预约'}], 'type': 'LIST'}, 'writable': True}, {'defaultValue': '35', 'desc': '目标温度', 'invisible': False, 'name': 'targetTemperature', 'operationType': 'I', 'readable': True, 'value': '51', 'valueRange': {'dataStep': {'dataType': 'Integer', 'maxValue': '80', 'minValue': '35', 'step': '1'}, 'type': 'STEP'}, 'writable': True}, {'defaultValue': 'false', 'desc': '预约1循环状态', 'invisible': False, 'name': 'resn1CycleStatus', 'operationType': 'G', 'readable': True, 'value': 'true', 'valueRange': {'dataList': [{'data': 'false', 'desc': '执行一次'}, {'data': 'true', 'desc': '循环'}], 'type': 'LIST'}, 'writable': True}, {'defaultValue': '0', 'desc': '热泵模式最高设定温度', 'invisible': False, 'name': 'pumpModeMaxTemp', 'readable': True, 'value': '0', 'valueRange': {'dataList': [{'data': '0', 'desc': '80℃'}, {'data': '1', 'desc': '75℃'}, {'data': '2', 'desc': '65℃'}, {'data': '3', 'desc': '55℃'}], 'type': 'LIST'}, 'writable': False}, {'desc': '查询报警', 'invisible': True, 'name': 'getAllAlarm', 'operationType': 'I', 'readable': True, 'valueRange': {'dataList': [{'data': 'getAllAlarm'}], 'type': 'LIST'}, 'writable': True}, {'defaultValue': '35', 'desc': '预约1温度', 'invisible': False, 'name': 'resn1Temperature', 'operationType': 'G', 'readable': True, 'value': '68', 'valueRange': {'dataStep': {'dataType': 'Integer', 'maxValue': '80', 'minValue': '35', 'step': '1'}, 'type': 'STEP'}, 'writable': True}, {'defaultValue': '00:00', 'desc': '当前时间', 'invisible': False, 'name': 'time', 'operationType': 'I', 'readable': True, 'value': '15:23', 'valueRange': {'dataTime': {'format': 'HH:mm', 'maxHour': 23, 'maxMinute': 59, 'maxSecond': 0, 'minHour': 0, 'minMinute': 0, 'minSecond': 0}, 'type': 'TIME'}, 'writable': True}, {'defaultValue': 'false', 'desc': '双源速热模式', 'invisible': False, 'name': 'dualHeaterMode', 'operationType': 'I', 'readable': True, 'value': 'false', 'valueRange': {'dataList': [{'data': 'false', 'desc': '关'}, {'data': 'true', 'desc': '开'}], 'type': 'LIST'}, 'writable': True}, {'defaultValue': 'false', 'desc': '开关机状态', 'invisible': False, 'name': 'onOffStatus', 'operationType': 'I', 'readable': True, 'value': 'true', 'valueRange': {'dataList': [{'data': 'false', 'desc': '关机'}, {'data': 'true', 'desc': '开机'}], 'type': 'LIST'}, 'writable': True}]
image image
banto6 commented 3 weeks ago

感谢PR,我看了一下代码,空气能热水器基本上都是独立的字段,那新增一个HaierWaterHeater classs会好一点吧,这样对原有燃气热水器的功能侵入比较小

staritbusfans commented 3 weeks ago

感谢PR,我看了一下代码,空气能热水器基本上都是独立的字段,那新增一个HaierWaterHeater classs会好一点吧,这样对原有燃气热水器的功能侵入比较小

这样也好,更方便同时兼容电热水器。同样是海尔热水器的设置温度,空气能和燃气一个是targetTemperature,一个是targetTemp😂