Skip to content

Commit

Permalink
Add Support for 527E (#9)
Browse files Browse the repository at this point in the history
* Added support for 527E

* Added support for 527E

* Add support for 527E
  • Loading branch information
crgreenwood committed May 18, 2021
1 parent 5a3ccbf commit 714073b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libdyson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
DEVICE_TYPE_PURE_COOL_LINK,
DEVICE_TYPE_PURE_COOL_LINK_DESK,
DEVICE_TYPE_PURE_HOT_COOL,
DEVICE_TYPE_PURE_HOT_COOL_NEW,
DEVICE_TYPE_PURE_HOT_COOL_LINK,
DEVICE_TYPE_PURE_HOT_COOL_LINK_NEW,
DEVICE_TYPE_PURE_HUMIDIFY_COOL,
Expand Down Expand Up @@ -58,7 +59,10 @@ def get_device(serial: str, credential: str, device_type: str) -> Optional[Dyson
DEVICE_TYPE_PURE_HOT_COOL_LINK_NEW,
]:
return DysonPureHotCoolLink(serial, credential, device_type)
if device_type == DEVICE_TYPE_PURE_HOT_COOL:
if device_type in [
DEVICE_TYPE_PURE_HOT_COOL,
DEVICE_TYPE_PURE_HOT_COOL_NEW,
]:
return DysonPureHotCool(serial, credential, device_type)
if device_type == DEVICE_TYPE_PURE_HUMIDIFY_COOL:
return DysonPureHumidifyCool(serial, credential, device_type)
Expand Down
2 changes: 2 additions & 0 deletions libdyson/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
DEVICE_TYPE_PURE_HOT_COOL_LINK = "455"
DEVICE_TYPE_PURE_HOT_COOL_LINK_NEW = "455A"
DEVICE_TYPE_PURE_HOT_COOL = "527"
DEVICE_TYPE_PURE_HOT_COOL_NEW = "527E"

DEVICE_TYPE_NAMES = {
DEVICE_TYPE_360_EYE: "360 Eye robot vacuum",
Expand All @@ -22,6 +23,7 @@
DEVICE_TYPE_PURE_COOL_LINK: "Pure Cool Link",
DEVICE_TYPE_PURE_COOL_LINK_DESK: "Pure Cool Link Desk",
DEVICE_TYPE_PURE_HOT_COOL: "Pure Hot+Cool",
DEVICE_TYPE_PURE_HOT_COOL_NEW: "Pure Hot+Cool (New)",
DEVICE_TYPE_PURE_HOT_COOL_LINK: "Pure Hot+Cool Link",
DEVICE_TYPE_PURE_HOT_COOL_LINK_NEW: "Pure Hot+Cool Link (New)",
DEVICE_TYPE_PURE_HUMIDIFY_COOL: "Pure Humidify+Cool",
Expand Down
2 changes: 2 additions & 0 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
DEVICE_TYPE_PURE_COOL_LINK,
DEVICE_TYPE_PURE_COOL_LINK_DESK,
DEVICE_TYPE_PURE_HOT_COOL,
DEVICE_TYPE_PURE_HOT_COOL_NEW,
DEVICE_TYPE_PURE_HOT_COOL_LINK,
DEVICE_TYPE_PURE_HOT_COOL_LINK_NEW,
DEVICE_TYPE_PURE_HUMIDIFY_COOL,
Expand Down Expand Up @@ -42,6 +43,7 @@
(DEVICE_TYPE_PURE_HOT_COOL_LINK, DysonPureHotCoolLink),
(DEVICE_TYPE_PURE_HOT_COOL_LINK_NEW, DysonPureHotCoolLink),
(DEVICE_TYPE_PURE_HOT_COOL, DysonPureHotCool),
(DEVICE_TYPE_PURE_HOT_COOL_NEW, DysonPureHotCool),
(DEVICE_TYPE_PURE_HUMIDIFY_COOL, DysonPureHumidifyCool),
],
)
Expand Down

0 comments on commit 714073b

Please sign in to comment.