fix: fixes after first test
This commit is contained in:
parent
a24b2fbc50
commit
50f7443f73
|
|
@ -11,7 +11,7 @@ class RoboVac(TuyaDevice):
|
||||||
""""""
|
""""""
|
||||||
|
|
||||||
def __init__(self, model_code, *args, **kwargs):
|
def __init__(self, model_code, *args, **kwargs):
|
||||||
if model_code not in ROBOVAC_MODELS[model_code] is None:
|
if model_code not in ROBOVAC_MODELS:
|
||||||
raise ModelNotSupportedException(
|
raise ModelNotSupportedException(
|
||||||
"Model {} is not supported".format(model_code)
|
"Model {} is not supported".format(model_code)
|
||||||
)
|
)
|
||||||
|
|
@ -26,20 +26,20 @@ class RoboVac(TuyaDevice):
|
||||||
return self.model_details.robovac_features
|
return self.model_details.robovac_features
|
||||||
|
|
||||||
def getFanSpeeds(self):
|
def getFanSpeeds(self):
|
||||||
return self.model_details.commands[RobovacCommand.FAN_SPEED].values
|
return self.model_details.commands[RobovacCommand.FAN_SPEED]["values"]
|
||||||
|
|
||||||
def getModes(self):
|
def getModes(self):
|
||||||
return self.model_details.commands[RobovacCommand.MODE].values
|
return self.model_details.commands[RobovacCommand.MODE]["values"]
|
||||||
|
|
||||||
def getSupportedCommands(self):
|
def getSupportedCommands(self):
|
||||||
return list(self.model_details.commands.keys())
|
return list(self.model_details.commands.keys())
|
||||||
|
|
||||||
def getCommandCodes(self):
|
def getCommandCodes(self):
|
||||||
command_codes = {}
|
command_codes = {}
|
||||||
for key, value in self.model_details.commands:
|
for key, value in self.model_details.commands.items():
|
||||||
if isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
command_codes[key] = value.code
|
command_codes[key] = str(value["code"])
|
||||||
else:
|
else:
|
||||||
command_codes[key] = value
|
command_codes[key] = str(value)
|
||||||
|
|
||||||
return command_codes
|
return command_codes
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue