Skip to content

Commit

Permalink
fix: External device status model #80
Browse files Browse the repository at this point in the history
  • Loading branch information
petrleocompel committed Jan 17, 2024
1 parent 37cc687 commit 8c93805
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/hikvision_axpro/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1869,7 +1869,7 @@ class OutputMod:
power_load: Optional[int] = None
energy_sum_vaule: Optional[int] = None
relay_list: Optional[List[RelayList]] = None
volt_value_v20: Optional[int] = None
volt_value_v20: Optional[float] = None

@staticmethod
def from_dict(obj: Any) -> 'OutputMod':
Expand All @@ -1889,7 +1889,7 @@ def from_dict(obj: Any) -> 'OutputMod':
power_load = from_union([from_int, from_none], obj.get("powerLoad"))
energy_sum_vaule = from_union([from_int, from_none], obj.get("energySumVaule"))
relay_list = from_union([lambda x: from_list(RelayList.from_dict, x), from_none], obj.get("relayList"))
volt_value_v20 = from_union([from_int, from_none], obj.get("voltValueV20"))
volt_value_v20 = from_union([from_float, from_none], obj.get("voltValueV20"))
return OutputMod(id, seq, status, tamper_evident, charge, signal, model, temperature, is_via_repeater, repeater_name, volt_value, current_value, power_load, energy_sum_vaule, relay_list, volt_value_v20)

def to_dict(self) -> dict:
Expand Down Expand Up @@ -1925,7 +1925,7 @@ def to_dict(self) -> dict:
if self.relay_list is not None:
result["relayList"] = from_union([lambda x: from_list(lambda x: to_class(RelayList, x), x), from_none], self.relay_list)
if self.volt_value_v20 is not None:
result["voltValueV20"] = from_union([from_int, from_none], self.volt_value_v20)
result["voltValueV20"] = from_union([from_float, from_none], self.volt_value_v20)
return result


Expand Down

0 comments on commit 8c93805

Please # to comment.