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

Added additional OperatingModes and FaultStatuses for dreamevacuum #1090

Merged
merged 7 commits into from
Jul 8, 2021
Merged
Changes from 1 commit
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
15 changes: 9 additions & 6 deletions miio/dreamevacuum_miot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

from .click_common import command, format_output
from .miot_device import DeviceStatus as DeviceStatusContainer
from .miot_device import MiotDevice, MiotMapping
from .miot_device import MiotDevice

_LOGGER = logging.getLogger(__name__)

_MAPPING: MiotMapping = {
_MAPPING = {
rytilahti marked this conversation as resolved.
Show resolved Hide resolved
"battery_level": {"siid": 2, "piid": 1},
"charging_state": {"siid": 2, "piid": 2},
"device_fault": {"siid": 3, "piid": 1},
Expand Down Expand Up @@ -56,9 +56,13 @@ class CleaningMode(Enum):

class OperatingMode(Enum):
Unknown = -1
Paused = 1
Cleaning = 2
GoCharging = 3
Paused = 14
rytilahti marked this conversation as resolved.
Show resolved Hide resolved
Charging = 6
ManualCleaning = 13
ZonedCleaning = 19
ManualPaused = 17
rytilahti marked this conversation as resolved.
Show resolved Hide resolved


class FaultStatus(Enum):
Expand All @@ -69,6 +73,7 @@ class FaultStatus(Enum):
class DeviceStatus(Enum):
Unknown = -1
Sweeping = 1
ManualSweeping = 13
rytilahti marked this conversation as resolved.
Show resolved Hide resolved
Idle = 2
Paused = 3
Error = 4
Expand Down Expand Up @@ -275,13 +280,11 @@ def reset_sidebrush_life(self) -> None:
"""Reset side brush life."""
return self.send_action(28, 1)

def get_properties_for_mapping(self, *, max_properties=15) -> list:
def get_properties_for_mapping(self) -> list:
rytilahti marked this conversation as resolved.
Show resolved Hide resolved
"""Retrieve raw properties based on mapping.

Method was copied from the base class to change the value of max_properties to
10. This change is needed to avoid "Checksum error" messages from the device.

# TODO: miotdevice class should have a possibility to define its max_properties value
"""

# We send property key in "did" because it's sent back via response and we can identify the property.
Expand Down