Fix indentation
This commit is contained in:
35
HCDevice.py
35
HCDevice.py
@@ -119,14 +119,14 @@ class HCDevice:
|
|||||||
f" program - {feature['name']}."
|
f" program - {feature['name']}."
|
||||||
)
|
)
|
||||||
|
|
||||||
if "options" in data:
|
if "options" in data:
|
||||||
for option in data["options"]:
|
for option in data["options"]:
|
||||||
option_uid = option["uid"]
|
option_uid = option["uid"]
|
||||||
if str(option_uid) not in self.features:
|
if str(option_uid) not in self.features:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Unable to configure appliance. Option UID {option_uid} is not"
|
f"Unable to configure appliance. Option UID {option_uid} is not"
|
||||||
" valid for this device."
|
" valid for this device."
|
||||||
)
|
)
|
||||||
|
|
||||||
# Test the feature of an appliance agains a data object
|
# Test the feature of an appliance agains a data object
|
||||||
def test_feature(self, data_array):
|
def test_feature(self, data_array):
|
||||||
@@ -169,15 +169,16 @@ class HCDevice:
|
|||||||
f"Unable to configure appliance. The value {data['value']} must be an integer."
|
f"Unable to configure appliance. The value {data['value']} must be an integer."
|
||||||
f" Allowed values are {feature['values']}."
|
f" Allowed values are {feature['values']}."
|
||||||
)
|
)
|
||||||
value = str(data["value"])
|
|
||||||
# values are strings in the feature list,
|
value = str(data["value"])
|
||||||
# but always seem to be an integer. An integer must be provided
|
# values are strings in the feature list,
|
||||||
if value not in feature["values"]:
|
# but always seem to be an integer. An integer must be provided
|
||||||
raise Exception(
|
if value not in feature["values"]:
|
||||||
"Unable to configure appliance. "
|
raise Exception(
|
||||||
f"Value {data['value']} is not a valid value. "
|
"Unable to configure appliance. "
|
||||||
f"Allowed values are {feature['values']}. "
|
f"Value {data['value']} is not a valid value. "
|
||||||
)
|
f"Allowed values are {feature['values']}. "
|
||||||
|
)
|
||||||
|
|
||||||
if "min" in feature:
|
if "min" in feature:
|
||||||
min = int(feature["min"])
|
min = int(feature["min"])
|
||||||
|
|||||||
Reference in New Issue
Block a user