Skip to content

Commit

Permalink
Minor viomi cleanups (#1742)
Browse files Browse the repository at this point in the history
* Move misplaced viomivacuum into viomi/vacuum
* Disable unknown sensors
* Unmark error to be a standard id, as it's not really used by
homeassistant
  • Loading branch information
rytilahti authored Feb 20, 2023
1 parent 7bd3e34 commit eca56e1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion miio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
from miio.integrations.scishare.coffee import ScishareCoffee
from miio.integrations.shuii.humidifier import AirHumidifierJsq
from miio.integrations.tinymu.toiletlid import Toiletlid
from miio.integrations.viomi.viomi import ViomiVacuum
from miio.integrations.viomi.vacuum import ViomiVacuum
from miio.integrations.viomi.viomidishwasher import ViomiDishwasher
from miio.integrations.xiaomi.aircondition.airconditioner_miot import AirConditionerMiot
from miio.integrations.xiaomi.repeater.wifirepeater import WifiRepeater
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ def error_code(self) -> int:
return self.data["err_state"]

@property
@sensor("Error", icon="mdi:alert", id=VacuumId.ErrorMessage)
@sensor("Error", icon="mdi:alert")
def error(self) -> Optional[str]:
"""String presentation for the error code."""
if self.vacuum_state != VacuumState.Error:
Expand Down Expand Up @@ -471,7 +471,7 @@ def is_on(self) -> bool:
return not bool(self.data["is_work"])

@property
@setting("LED state", setter_name="led", icon="mdi:led-outline")
@setting("LED", setter_name="led", icon="mdi:led-outline")
def led_state(self) -> bool:
"""Led state.
Expand Down Expand Up @@ -501,26 +501,24 @@ def route_pattern(self) -> Optional[ViomiRoutePattern]:
return ViomiRoutePattern(route)

@property
@sensor("Order time?")
def order_time(self) -> int:
"""FIXME: ??? int or bool."""
"""Unknown."""
return self.data["order_time"]

@property
@setting("Repeat cleaning active", setter_name="set_repeat_cleaning")
def start_time(self) -> int:
"""Unknown."""
return self.data["start_time"]

@property
@setting("Clean twice", setter_name="set_repeat_cleaning")
def repeat_cleaning(self) -> bool:
"""Secondary clean up state.
True if the cleaning is performed twice
"""
return bool(self.data["repeat_state"])

@property
@sensor("Start time")
def start_time(self) -> int:
"""FIXME: ??? int or bool."""
return self.data["start_time"]

@property
@setting(
"Sound volume",
Expand All @@ -539,9 +537,8 @@ def water_percent(self) -> int:
return self.data.get("water_percent")

@property
@sensor("Zone data")
def zone_data(self) -> int:
"""FIXME: ??? int or bool."""
"""Unknown."""
return self.data["zone_data"]


Expand Down

0 comments on commit eca56e1

Please sign in to comment.