Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Dehumidifier H7151 #8

Open
Mdleal opened this issue May 22, 2024 · 4 comments
Open

Add Support for Dehumidifier H7151 #8

Mdleal opened this issue May 22, 2024 · 4 comments

Comments

@Mdleal
Copy link

Mdleal commented May 22, 2024

No description provided.

@disforw
Copy link
Owner

disforw commented May 22, 2024

Sweet, can you post an API response? We can put this in humidifier.py only change the attr_device_class = HumidifierDeviceClass.HUMIDIFIER if it shows it as different in your response.

@Mdleal
Copy link
Author

Mdleal commented May 23, 2024

{
"code": 200,
"message": "success",
"data": [{
"sku": "H7151",
"device": "1C:23:D4:AD:FC:F2:F8:40",
"deviceName": "Smart Dehumidifier Max",
"type": "devices.types.dehumidifier",
"capabilities": [{
"type": "devices.capabilities.on_off",
"instance": "powerSwitch",
"parameters": {
"dataType": "ENUM",
"options": [{
"name": "on",
"value": 1
}, {
"name": "off",
"value": 0
}]
}
}, {
"type": "devices.capabilities.range",
"instance": "humidity",
"parameters": {
"unit": "unit.percent",
"dataType": "INTEGER",
"range": {
"min": 30,
"max": 80,
"precision": 1
}
}
}, {
"type": "devices.capabilities.work_mode",
"instance": "workMode",
"parameters": {
"dataType": "STRUCT",
"fields": [{
"fieldName": "workMode",
"dataType": "ENUM",
"options": [{
"name": "gearMode",
"value": 1
}, {
"name": "Auto",
"value": 3
}, {
"name": "Dryer",
"value": 8
}],
"required": true
}, {
"fieldName": "modeValue",
"dataType": "ENUM",
"options": [{
"name": "gearMode",
"options": [{
"name": "Low",
"value": 1
}, {
"name": "Medium",
"value": 2
}, {
"name": "High",
"value": 3
}]
}, {
"name": "Auto",
"range": {
"min": 80,
"max": 80
}
}, {
"defaultValue": 0,
"name": "Dryer"
}],
"required": true
}]
}
}, {
"type": "devices.capabilities.event",
"instance": "waterFullEvent",
"alarmType": 58,
"eventState": {
"options": [{
"name": "waterFull",
"value": 1,
"message": "Water bucket is full or has been pulled out"
}]
}
}]
}]
}

@disforw
Copy link
Owner

disforw commented May 23, 2024

Adding new beta 2.9.3 that will add dehumidifier to device class

@Mdleal
Copy link
Author

Mdleal commented May 24, 2024

dehumidifier added as unavoidable.

ERROR (MainThread) [custom_components.goveelife.entities] GoveeLife - 1c23d4adfcf2f840_humidifier: init failed: 'value' (builtins.KeyError)

[homeassistant.helpers.entity_registry] Registered new humidifier.goveelife entity: humidifier.smart_dehumidifier_max_2
2024-05-23 22:36:56.454 ERROR (MainThread) [homeassistant.components.humidifier] Error adding entity humidifier.smart_dehumidifier_max_2 for domain humidifier with platform goveelife
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 580, in _async_add_entities
await coro
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 892, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1359, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1009, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
state, attr, capabilities, shadowed_attr = self.__async_calculate_state()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1067, in __async_calculate_state
state = self._stringify_state(available)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1015, in _stringify_state
if (state := self.state) is None:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1665, in state
if (is_on := self.is_on) is None:
^^^^^^^^^^
File "/config/custom_components/goveelife/humidifier.py", line 149, in is_on
if self.state == STATE_ON:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1665, in state
if (is_on := self.is_on) is None:
^^^^^^^^^^
File "/config/custom_components/goveelife/humidifier.py", line 149, in is_on
if self.state == STATE_ON:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1665, in state
if (is_on := self.is_on) is None:
^^^^^^^^^^
File "/config/custom_components/goveelife/humidifier.py", line 149, in is_on
if self.state == STATE_ON:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1665, in state
if (is_on := self.is_on) is None:
^^^^^^^^^^
File "/config/custom_components/goveelife/humidifier.py", line 149, in is_on
if self.state == STATE_ON:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1665, in state
if (is_on := self.is_on) is None:
^^^^^^^^^^
File "/config/custom_components/goveelife/humidifier.py", line 149, in is_on
if self.state == STATE_ON:
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1665, in state
if (is_on := self.is_on) is None:
^^^^^^^^^^
.......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants