-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Please add new model #31
Comments
I've used PR #30 as a base to manually add support and it connects fine, so it's just a matter of adding a few lines to support it. I'll try to see if I can open a PR myself to add proper support for it including the formaldehyde sensor. |
Okay so here's what I've got so far : diff --git a/libdyson/libdyson/__init__.py b/libdyson-new/__init__.py
index 7b05791..ae8fb07 100644
--- a/libdyson/libdyson/__init__.py
+++ b/libdyson-new/__init__.py
@@ -15,6 +15,7 @@ from .const import (
DEVICE_TYPE_PURE_HOT_COOL_LINK,
DEVICE_TYPE_PURE_HUMIDIFY_COOL,
DEVICE_TYPE_PURIFIER_HUMIDIFY_COOL_FORMALDEHYDE,
+ DEVICE_TYPE_PURE_HOT_COOL_FORMALDEHYDE,
)
from .const import CleaningMode # noqa: F401
from .const import CleaningType # noqa: F401
@@ -32,7 +33,7 @@ from .dyson_device import DysonDevice
from .dyson_pure_cool import DysonPureCool
from .dyson_pure_cool import DysonPureCoolFormaldehyde
from .dyson_pure_cool_link import DysonPureCoolLink
-from .dyson_pure_hot_cool import DysonPureHotCool
+from .dyson_pure_hot_cool import DysonPureHotCool, DysonPureHotCoolFormaldehyde
from .dyson_pure_hot_cool_link import DysonPureHotCoolLink
from .dyson_pure_humidify_cool import DysonPureHumidifyCool, DysonPurifierHumidifyCoolFormaldehyde
from .utils import get_mqtt_info_from_wifi_info # noqa: F401
@@ -58,6 +59,8 @@ def get_device(serial: str, credential: str, device_type: str) -> Optional[Dyson
return DysonPureCoolFormaldehyde(serial, credential, device_type)
if device_type == DEVICE_TYPE_PURE_HOT_COOL_LINK:
return DysonPureHotCoolLink(serial, credential, device_type)
+ if device_type == DEVICE_TYPE_PURE_HOT_COOL_FORMALDEHYDE:
+ return DysonPureHotCoolFormaldehyde(serial, credential, device_type)
if device_type in [
DEVICE_TYPE_PURE_HOT_COOL,
DEVICE_TYPE_PURE_HOT_COOL_NEW,
diff --git a/libdyson/libdyson/const.py b/libdyson-new/const.py
index 254e1cb..d655aa0 100644
--- a/libdyson/libdyson/const.py
+++ b/libdyson-new/const.py
@@ -13,6 +13,7 @@ DEVICE_TYPE_PURIFIER_HUMIDIFY_COOL_FORMALDEHYDE = "358E"
DEVICE_TYPE_PURE_HOT_COOL_LINK = "455"
DEVICE_TYPE_PURE_HOT_COOL = "527"
DEVICE_TYPE_PURE_HOT_COOL_NEW = "527E"
+DEVICE_TYPE_PURE_HOT_COOL_FORMALDEHYDE = "527K"
DEVICE_TYPE_NAMES = {
DEVICE_TYPE_360_EYE: "360 Eye robot vacuum",
@@ -27,6 +28,7 @@ DEVICE_TYPE_NAMES = {
DEVICE_TYPE_PURE_HOT_COOL_LINK: "Pure Hot+Cool Link",
DEVICE_TYPE_PURE_HUMIDIFY_COOL: "Pure Humidify+Cool",
DEVICE_TYPE_PURIFIER_HUMIDIFY_COOL_FORMALDEHYDE: "Purifier Humidify+Cool Formaldehyde",
+ DEVICE_TYPE_PURE_HOT_COOL_FORMALDEHYDE: "Pure Hot+Cool Formaldehyde"
}
ENVIRONMENTAL_OFF = -1
diff --git a/libdyson/libdyson/dyson_pure_hot_cool.py b/libdyson-new/dyson_pure_hot_cool.py
index 3ceb789..561b383 100644
--- a/libdyson/libdyson/dyson_pure_hot_cool.py
+++ b/libdyson-new/dyson_pure_hot_cool.py
@@ -1,8 +1,17 @@
"""Dyson Pure Hot+Cool device."""
+from typing import Optional
+
from .dyson_device import DysonHeatingDevice
from .dyson_pure_cool import DysonPureCool
-
class DysonPureHotCool(DysonPureCool, DysonHeatingDevice):
"""Dyson Pure Hot+Cool device."""
+
+class DysonPureHotCoolFormaldehyde(DysonPureHotCool):
+ """Dyson Pure Hot+Cool Formaldehyde device."""
+
+ @property
+ def formaldehyde(self) -> Optional[int]:
+ """Return formaldehyde reading."""
+ return self._get_environmental_field_value("hcho") Instantiates and works fine, but the formaldehyde entity is still missing, not sure why. |
Quick update, this actually works fine, I was just missing a change in the actual integration to use that sensor. Basically in sensor.py for the dyson local integration you just need to add I'll open proper PRs now |
Hi, do you have news for Formaldehyde sensor? |
@terzo33 Have a look at my two PRs, works fine with them |
Can I have link? Thanks
I understood that to see the Formaldehyde sensor I have to modify the sensor.py file but I didn't understand where to put my hands, could you paste your sensor.py here? A thousand thanks |
I made the change on import and then I add this string here(line 81). is that okay? |
I managed to integrate the Formaldehyde sensor but the values do not coincide with the Dyson application values. for example on the Dyson application it marks 0.004 mg/m3 while on the home assistant it marks 1.5 (without units of measurement). even if on the Dyson application the unit of measurement is mg/m3 and on HA it is µg/m3... 0.004mg/m3 would be 4µg/m3 and not 1.5 as marked on the home assistant. so there is something wrong... |
Yes, the formaldehyde sensor in the current version isn't correctly defined, that's also addressed in my PR. |
Hello,
First of all, thank you for the working local integration. My TP09 is now FINALLY in HA. Would it be possible to update the database for the newer models too please? The one missing for me is Purifier Hot+Cool Formaldehyde™ (HP09, Device Type is 527K).
Thank you!
The text was updated successfully, but these errors were encountered: