Skip to content

Commit

Permalink
Adding support for 527K - Dyson Pure Hot+Cool Formaldehyde
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrar committed Dec 12, 2022
1 parent 3137808 commit 6a8ed5c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 4 additions & 1 deletion libdyson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
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
Expand All @@ -32,7 +33,7 @@
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
Expand All @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions libdyson/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
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",
Expand All @@ -27,6 +28,7 @@
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
Expand Down
11 changes: 10 additions & 1 deletion libdyson/dyson_pure_hot_cool.py
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 6a8ed5c

Please sign in to comment.