1
0
mirror of https://github.com/no2chem/wideq.git synced 2025-05-16 07:10:09 -07:00

Whitespace fixes

This commit is contained in:
Adrian Sampson 2019-08-12 09:37:22 -04:00
parent 0610d0f0b7
commit 78b48f0831
2 changed files with 10 additions and 6 deletions

View File

@ -2,7 +2,8 @@ import json
import unittest
from wideq.client import Client, DeviceInfo
from wideq.dishwasher import DishWasherDevice, DishWasherState, DishWasherStatus
from wideq.dishwasher import DishWasherDevice, DishWasherState, \
DishWasherStatus
POLL_DATA = {
"16~19": "0",

View File

@ -8,13 +8,14 @@ from .util import lookup_enum, lookup_reference
class DishWasherState(enum.Enum):
"""The state of the dishwasher device."""
INITIAL = '@DW_STATE_INITIAL_W'
RUNNING = '@DW_STATE_RUNNING_W'
RUNNING = '@DW_STATE_RUNNING_W'
PAUSED = "@DW_STATE_PAUSE_W"
OFF = '@DW_STATE_POWER_OFF_W'
COMPLETE = '@DW_STATE_COMPLETE_W'
POWER_FAIL = "@DW_STATE_POWER_FAIL_W"
DISHWASHER_STATE_READABLE = {
DISHWASHER_STATE_READABLE = {
'INITIAL': 'Standby',
'RUNNING': 'Running',
'PAUSED': 'Paused',
@ -34,6 +35,7 @@ class DishWasherProcess(enum.Enum):
NIGHT_DRYING = '@DW_STATE_NIGHTDRY_W'
CANCELLED = '@DW_STATE_CANCEL_W'
DISHWASHER_PROCESS_READABLE = {
'RESERVE': 'Delayed Start',
'RUNNING': DISHWASHER_STATE_READABLE['RUNNING'],
@ -44,6 +46,7 @@ DISHWASHER_PROCESS_READABLE = {
'CANCELLED': 'Cancelled',
}
# Provide a map to correct typos in the official course names.
DISHWASHER_COURSE_MAP = {
'Haeavy': 'Heavy',
@ -90,7 +93,7 @@ class DishWasherStatus(object):
return DishWasherState(
lookup_enum('State', self.data, self.dishwasher))
@property
@property
def readable_state(self) -> str:
"""Get a human readable state of the dishwasher."""
return DISHWASHER_STATE_READABLE[self.state.name]
@ -104,14 +107,14 @@ class DishWasherStatus(object):
else:
return None
@property
@property
def readable_process(self) -> str:
"""Get a human readable process of the dishwasher."""
if self.process:
return DISHWASHER_PROCESS_READABLE[self.process.name]
else:
return None
@property
def is_on(self) -> bool:
"""Check if the dishwasher is on or not."""