mirror of
https://github.com/sususweet/midea-meiju-codec.git
synced 2025-11-12 07:51:54 +00:00
feat: change entity for water heater.
This commit is contained in:
@@ -140,11 +140,6 @@ async def update_listener(hass: HomeAssistant, config_entry: ConfigEntry):
|
|||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, config: ConfigType):
|
async def async_setup(hass: HomeAssistant, config: ConfigType):
|
||||||
hass.data.setdefault(DOMAIN, {})
|
hass.data.setdefault(DOMAIN, {})
|
||||||
|
|
||||||
# 使用Home Assistant配置目录而不是当前工作目录
|
|
||||||
config_dir = hass.config.path(DOMAIN)
|
|
||||||
os.makedirs(config_dir, exist_ok=True)
|
|
||||||
|
|
||||||
os.makedirs(hass.config.path(STORAGE_PATH), exist_ok=True)
|
os.makedirs(hass.config.path(STORAGE_PATH), exist_ok=True)
|
||||||
lua_path = hass.config.path(STORAGE_PATH)
|
lua_path = hass.config.path(STORAGE_PATH)
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ DEVICE_MAPPING = {
|
|||||||
"queries": [{}],
|
"queries": [{}],
|
||||||
"centralized": [],
|
"centralized": [],
|
||||||
"entities": {
|
"entities": {
|
||||||
Platform.WATER_HEATER: {
|
Platform.CLIMATE: {
|
||||||
"water_heater": {
|
"water_heater": {
|
||||||
"power": "power",
|
"power": "power",
|
||||||
"operation_list": {
|
"hvac_modes": {
|
||||||
"off": {"power": "off"},
|
"off": {"power": "off"},
|
||||||
"on": {"power": "on"},
|
"on": {"power": "on"},
|
||||||
},
|
},
|
||||||
@@ -26,6 +26,9 @@ DEVICE_MAPPING = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
Platform.SWITCH: {
|
Platform.SWITCH: {
|
||||||
|
"power": {
|
||||||
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
|
},
|
||||||
"ti_protect": {
|
"ti_protect": {
|
||||||
"device_class": SwitchDeviceClass.SWITCH,
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,6 +10,9 @@ DEVICE_MAPPING = {
|
|||||||
"centralized": [],
|
"centralized": [],
|
||||||
"entities": {
|
"entities": {
|
||||||
Platform.SWITCH: {
|
Platform.SWITCH: {
|
||||||
|
"power": {
|
||||||
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
|
},
|
||||||
"bubble": {
|
"bubble": {
|
||||||
"device_class": SwitchDeviceClass.SWITCH,
|
"device_class": SwitchDeviceClass.SWITCH,
|
||||||
"rationale": [0, 1]
|
"rationale": [0, 1]
|
||||||
|
|||||||
Reference in New Issue
Block a user