mirror of
https://github.com/no2chem/wideq.git
synced 2025-05-16 07:10:09 -07:00
Whitespace fixes
This commit is contained in:
parent
0610d0f0b7
commit
78b48f0831
@ -2,7 +2,8 @@ import json
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from wideq.client import Client, DeviceInfo
|
from wideq.client import Client, DeviceInfo
|
||||||
from wideq.dishwasher import DishWasherDevice, DishWasherState, DishWasherStatus
|
from wideq.dishwasher import DishWasherDevice, DishWasherState, \
|
||||||
|
DishWasherStatus
|
||||||
|
|
||||||
POLL_DATA = {
|
POLL_DATA = {
|
||||||
"16~19": "0",
|
"16~19": "0",
|
||||||
|
@ -8,13 +8,14 @@ from .util import lookup_enum, lookup_reference
|
|||||||
class DishWasherState(enum.Enum):
|
class DishWasherState(enum.Enum):
|
||||||
"""The state of the dishwasher device."""
|
"""The state of the dishwasher device."""
|
||||||
INITIAL = '@DW_STATE_INITIAL_W'
|
INITIAL = '@DW_STATE_INITIAL_W'
|
||||||
RUNNING = '@DW_STATE_RUNNING_W'
|
RUNNING = '@DW_STATE_RUNNING_W'
|
||||||
PAUSED = "@DW_STATE_PAUSE_W"
|
PAUSED = "@DW_STATE_PAUSE_W"
|
||||||
OFF = '@DW_STATE_POWER_OFF_W'
|
OFF = '@DW_STATE_POWER_OFF_W'
|
||||||
COMPLETE = '@DW_STATE_COMPLETE_W'
|
COMPLETE = '@DW_STATE_COMPLETE_W'
|
||||||
POWER_FAIL = "@DW_STATE_POWER_FAIL_W"
|
POWER_FAIL = "@DW_STATE_POWER_FAIL_W"
|
||||||
|
|
||||||
DISHWASHER_STATE_READABLE = {
|
|
||||||
|
DISHWASHER_STATE_READABLE = {
|
||||||
'INITIAL': 'Standby',
|
'INITIAL': 'Standby',
|
||||||
'RUNNING': 'Running',
|
'RUNNING': 'Running',
|
||||||
'PAUSED': 'Paused',
|
'PAUSED': 'Paused',
|
||||||
@ -34,6 +35,7 @@ class DishWasherProcess(enum.Enum):
|
|||||||
NIGHT_DRYING = '@DW_STATE_NIGHTDRY_W'
|
NIGHT_DRYING = '@DW_STATE_NIGHTDRY_W'
|
||||||
CANCELLED = '@DW_STATE_CANCEL_W'
|
CANCELLED = '@DW_STATE_CANCEL_W'
|
||||||
|
|
||||||
|
|
||||||
DISHWASHER_PROCESS_READABLE = {
|
DISHWASHER_PROCESS_READABLE = {
|
||||||
'RESERVE': 'Delayed Start',
|
'RESERVE': 'Delayed Start',
|
||||||
'RUNNING': DISHWASHER_STATE_READABLE['RUNNING'],
|
'RUNNING': DISHWASHER_STATE_READABLE['RUNNING'],
|
||||||
@ -44,6 +46,7 @@ DISHWASHER_PROCESS_READABLE = {
|
|||||||
'CANCELLED': 'Cancelled',
|
'CANCELLED': 'Cancelled',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Provide a map to correct typos in the official course names.
|
# Provide a map to correct typos in the official course names.
|
||||||
DISHWASHER_COURSE_MAP = {
|
DISHWASHER_COURSE_MAP = {
|
||||||
'Haeavy': 'Heavy',
|
'Haeavy': 'Heavy',
|
||||||
@ -90,7 +93,7 @@ class DishWasherStatus(object):
|
|||||||
return DishWasherState(
|
return DishWasherState(
|
||||||
lookup_enum('State', self.data, self.dishwasher))
|
lookup_enum('State', self.data, self.dishwasher))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def readable_state(self) -> str:
|
def readable_state(self) -> str:
|
||||||
"""Get a human readable state of the dishwasher."""
|
"""Get a human readable state of the dishwasher."""
|
||||||
return DISHWASHER_STATE_READABLE[self.state.name]
|
return DISHWASHER_STATE_READABLE[self.state.name]
|
||||||
@ -104,14 +107,14 @@ class DishWasherStatus(object):
|
|||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def readable_process(self) -> str:
|
def readable_process(self) -> str:
|
||||||
"""Get a human readable process of the dishwasher."""
|
"""Get a human readable process of the dishwasher."""
|
||||||
if self.process:
|
if self.process:
|
||||||
return DISHWASHER_PROCESS_READABLE[self.process.name]
|
return DISHWASHER_PROCESS_READABLE[self.process.name]
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self) -> bool:
|
def is_on(self) -> bool:
|
||||||
"""Check if the dishwasher is on or not."""
|
"""Check if the dishwasher is on or not."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user