This repository has been archived by the owner on Sep 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vendoring libdyson to avoid conflicts and other dependency install er…
…rors (#9)
- Loading branch information
Showing
25 changed files
with
1,923 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
"""Dyson Python library.""" | ||
|
||
from typing import Optional | ||
from .const import ( | ||
DEVICE_TYPE_360_EYE, | ||
DEVICE_TYPE_360_HEURIST, | ||
DEVICE_TYPE_PURE_COOL, | ||
DEVICE_TYPE_PURIFIER_COOL_E, | ||
DEVICE_TYPE_PURIFIER_COOL_K, | ||
DEVICE_TYPE_PURE_COOL_DESK, | ||
DEVICE_TYPE_PURE_COOL_LINK, | ||
DEVICE_TYPE_PURE_COOL_LINK_DESK, | ||
DEVICE_TYPE_PURE_HOT_COOL, | ||
DEVICE_TYPE_PURIFIER_HOT_COOL_E, | ||
DEVICE_TYPE_PURIFIER_HOT_COOL_K, | ||
DEVICE_TYPE_PURE_HOT_COOL_LINK, | ||
DEVICE_TYPE_PURE_HUMIDIFY_COOL, | ||
DEVICE_TYPE_PURIFIER_HUMIDIFY_COOL_E, | ||
DEVICE_TYPE_PURIFIER_HUMIDIFY_COOL_K, | ||
) | ||
|
||
from .const import CleaningMode # noqa: F401 | ||
from .const import CleaningType # noqa: F401 | ||
from .const import DEVICE_TYPE_NAMES # noqa: F401 | ||
from .const import HumidifyOscillationMode # noqa: F401 | ||
from .const import MessageType # noqa: F401 | ||
from .const import VacuumEyePowerMode # noqa: F401 | ||
from .const import VacuumHeuristPowerMode # noqa: F401 | ||
from .const import VacuumState # noqa: F401 | ||
from .const import WaterHardness # noqa: F401 | ||
from .discovery import DysonDiscovery # noqa: F401 | ||
from .dyson_360_eye import Dyson360Eye | ||
from .dyson_360_heurist import Dyson360Heurist | ||
from .dyson_device import DysonDevice | ||
from .dyson_pure_cool import DysonPureCool | ||
from .dyson_pure_cool_link import DysonPureCoolLink | ||
from .dyson_pure_hot_cool import DysonPureHotCool | ||
from .dyson_pure_hot_cool_link import DysonPureHotCoolLink | ||
from .dyson_pure_humidify_cool import DysonPurifierHumidifyCool | ||
from .utils import get_mqtt_info_from_wifi_info # noqa: F401 | ||
|
||
|
||
def get_device(serial: str, credential: str, device_type: str) -> Optional[DysonDevice]: | ||
"""Get a new DysonDevice instance.""" | ||
if device_type == DEVICE_TYPE_360_EYE: | ||
return Dyson360Eye(serial, credential) | ||
if device_type == DEVICE_TYPE_360_HEURIST: | ||
return Dyson360Heurist(serial, credential) | ||
if device_type in [ | ||
DEVICE_TYPE_PURE_COOL_LINK_DESK, | ||
DEVICE_TYPE_PURE_COOL_LINK, | ||
]: | ||
return DysonPureCoolLink(serial, credential, device_type) | ||
if device_type in [ | ||
DEVICE_TYPE_PURE_COOL, | ||
DEVICE_TYPE_PURIFIER_COOL_K, | ||
DEVICE_TYPE_PURIFIER_COOL_E, | ||
DEVICE_TYPE_PURE_COOL_DESK, | ||
]: | ||
return DysonPureCool(serial, credential, device_type) | ||
if device_type == DEVICE_TYPE_PURE_HOT_COOL_LINK: | ||
return DysonPureHotCoolLink(serial, credential, device_type) | ||
if device_type in [ | ||
DEVICE_TYPE_PURE_HOT_COOL, | ||
DEVICE_TYPE_PURIFIER_HOT_COOL_E, | ||
DEVICE_TYPE_PURIFIER_HOT_COOL_K, | ||
]: | ||
return DysonPureHotCool(serial, credential, device_type) | ||
if device_type in [ | ||
DEVICE_TYPE_PURE_HUMIDIFY_COOL, | ||
DEVICE_TYPE_PURIFIER_HUMIDIFY_COOL_K, | ||
DEVICE_TYPE_PURIFIER_HUMIDIFY_COOL_E, | ||
]: | ||
return DysonPurifierHumidifyCool(serial, credential, device_type) | ||
return None |
7 changes: 7 additions & 0 deletions
7
custom_components/dyson_cloud/vendor/libdyson/cloud/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"""Dyson cloud client.""" | ||
|
||
from .account import DysonAccount, DysonAccountCN # noqa: F401 | ||
from .cloud_360_eye import DysonCloud360Eye # noqa: F401 | ||
from .cloud_device import DysonCloudDevice # noqa: F401 | ||
from .device_info import DysonDeviceInfo # noqa: F401 | ||
from .regions import REGIONS # noqa: F401 |
Oops, something went wrong.