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

airhumidifer_(mj)jsq: Add use_time for better API compatibility #1179

Merged
merged 1 commit into from
Nov 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion miio/airhumidifier_jsq.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import enum
import logging
from typing import Any, Dict
from typing import Any, Dict, Optional

import click

Expand Down Expand Up @@ -129,6 +129,14 @@ def lid_opened(self) -> bool:
"""True if the water tank is detached."""
return self.data["lid_opened"] == 1

@property
def use_time(self) -> Optional[int]:
"""How long the device has been active in seconds.

Not supported by the device, so we return none here.
"""
return None


class AirHumidifierJsq(Device):
"""Implementation of Xiaomi Zero Fog Humidifier: shuii.humidifier.jsq001."""
Expand Down
8 changes: 8 additions & 0 deletions miio/airhumidifier_mjjsq.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ def wet_protection(self) -> Optional[bool]:

return None

@property
def use_time(self) -> Optional[int]:
"""How long the device has been active in seconds.

Not supported by the device, so we return none here.
"""
return None


class AirHumidifierMjjsq(Device):
"""Support for deerma.humidifier.(mj)jsq."""
Expand Down