mirror of
https://github.com/no2chem/wideq.git
synced 2025-05-18 08:10:17 -07:00
fix tox warnings and errors
This commit is contained in:
parent
763b6e5005
commit
4afd5685cb
@ -146,17 +146,17 @@ class Client(object):
|
|||||||
Return None if the device does not exist.
|
Return None if the device does not exist.
|
||||||
"""
|
"""
|
||||||
from . import util
|
from . import util
|
||||||
|
|
||||||
deviceInfo = self.get_device(device_id)
|
deviceInfo = self.get_device(device_id)
|
||||||
if deviceInfo == None:
|
if not deviceInfo:
|
||||||
return None
|
return None
|
||||||
classes = util.device_classes()
|
classes = util.device_classes()
|
||||||
if deviceInfo.type in classes:
|
if deviceInfo.type in classes:
|
||||||
return classes.get(deviceInfo.type)(self, deviceInfo)
|
return classes.get(deviceInfo.type)(self, deviceInfo)
|
||||||
LOGGER.debug('No specific subclass for deviceType %s, using default', deviceInfo.type)
|
LOGGER.debug('No specific subclass for deviceType %s, using default',
|
||||||
|
deviceInfo.type)
|
||||||
return Device(self, deviceInfo)
|
return Device(self, deviceInfo)
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def load(cls, state: Dict[str, Any]) -> 'Client':
|
def load(cls, state: Dict[str, Any]) -> 'Client':
|
||||||
"""Load a client from serialized state.
|
"""Load a client from serialized state.
|
||||||
|
@ -45,6 +45,6 @@ def device_classes():
|
|||||||
DeviceType.KIMCHI_REFRIGERATOR: RefrigeratorDevice,
|
DeviceType.KIMCHI_REFRIGERATOR: RefrigeratorDevice,
|
||||||
DeviceType.REFRIGERATOR: RefrigeratorDevice,
|
DeviceType.REFRIGERATOR: RefrigeratorDevice,
|
||||||
DeviceType.DISHWASHER: DishWasherDevice,
|
DeviceType.DISHWASHER: DishWasherDevice,
|
||||||
DeviceType.DRYER : DryerDevice,
|
DeviceType.DRYER: DryerDevice,
|
||||||
DeviceType.WASHER : WasherDevice,
|
DeviceType.WASHER: WasherDevice,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user