fix: move gear setting to preset_mode for T0xFB(570667EC)

* also add support for cur_temperature sensor
This commit is contained in:
Cyborg2017
2026-01-05 20:55:43 +08:00
parent a68ceb3104
commit 8820dbe8b1
3 changed files with 32 additions and 19 deletions

View File

@@ -84,6 +84,11 @@ DEVICE_MAPPING = {
"off": {"power": "off"},
"heat": {"power": "on"}
},
"preset_modes": {
"left_warm": {"gear": 1},
"right_warm": {"gear": 2},
"full_on": {"gear": 3}
},
"target_temperature": "temperature",
"current_temperature": "cur_temperature",
"min_temp": 5,
@@ -92,20 +97,16 @@ DEVICE_MAPPING = {
"precision": PRECISION_WHOLE,
}
},
Platform.SELECT: {
"gear": {
"options": {
"left_warm": {"gear": 1},
"right_warm": {"gear": 2},
"full_on": {"gear": 3}
}
}
},
Platform.SENSOR: {
"power_statistics": {
"device_class": SensorDeviceClass.POWER,
"unit_of_measurement": UnitOfPower.WATT,
"state_class": SensorStateClass.MEASUREMENT
},
"cur_temperature": {
"device_class": SensorDeviceClass.TEMPERATURE,
"unit_of_measurement": UnitOfTemperature.CELSIUS,
"state_class": SensorStateClass.MEASUREMENT
}
}
}

View File

@@ -396,7 +396,16 @@
"name": "Water Heater"
},
"electric_heater": {
"name": "Electric Heater"
"name": "Electric Heater",
"state_attributes": {
"preset_mode": {
"state": {
"left_warm": "Left Warm",
"right_warm": "Right Warm",
"full_on": "Full On"
}
}
}
},
"heating": {
"name": "Heating"
@@ -868,10 +877,7 @@
"state": {
"low": "Low",
"medium": "Medium",
"high": "High",
"left_warm": "Left Warm",
"right_warm": "Right Warm",
"full_on": "Full On"
"high": "High"
}
},
"ptc": {

View File

@@ -396,7 +396,16 @@
"name": "热水器"
},
"electric_heater": {
"name": "取暖器"
"name": "取暖器",
"state_attributes": {
"preset_mode": {
"state": {
"left_warm": "左暖",
"right_warm": "右暖",
"full_on": "全开"
}
}
}
},
"heating": {
"name": "采暖"
@@ -983,10 +992,7 @@
"state": {
"low": "低",
"medium": "中",
"high": "高",
"left_warm": "左暖",
"right_warm": "右暖",
"full_on": "全开"
"high": "高"
}
},
"ptc": {