Skip to content

Commit

Permalink
Merge pull request #467 from WillCodeForCats/new-entity-checks
Browse files Browse the repository at this point in the history
Handle available TypeError in number platform
  • Loading branch information
WillCodeForCats authored Nov 12, 2023
2 parents 3e358db + 045d18b commit aa16ca9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions custom_components/solaredge_modbus_multi/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def available(self) -> bool:
"ac_charge_policy"
] in [2, 3]

except KeyError:
except (TypeError, KeyError):
return False

@property
Expand Down Expand Up @@ -215,7 +215,7 @@ def available(self) -> bool:

return super().available

except KeyError:
except (TypeError, KeyError):
return False

@property
Expand Down Expand Up @@ -270,7 +270,7 @@ def available(self) -> bool:
and self._platform.decoded_storage_control["control_mode"] == 4
)

except KeyError:
except (TypeError, KeyError):
return False

@property
Expand Down Expand Up @@ -321,7 +321,7 @@ def available(self) -> bool:
and self._platform.decoded_storage_control["control_mode"] == 4
)

except KeyError:
except (TypeError, KeyError):
return False

@property
Expand Down Expand Up @@ -378,7 +378,7 @@ def available(self) -> bool:
and self._platform.decoded_storage_control["control_mode"] == 4
)

except KeyError:
except (TypeError, KeyError):
return False

@property
Expand Down Expand Up @@ -432,7 +432,7 @@ def available(self) -> bool:
or (int(self._platform.decoded_model["E_Lim_Ctl_Mode"]) >> 2) & 1
)

except KeyError:
except (TypeError, KeyError):
return False

@property
Expand Down Expand Up @@ -481,7 +481,7 @@ def available(self) -> bool:
and (int(self._platform.decoded_model["E_Lim_Ctl_Mode"]) >> 10) & 1
)

except KeyError:
except (TypeError, KeyError):
return False

@property
Expand Down Expand Up @@ -538,7 +538,7 @@ def available(self) -> bool:

return super().available

except KeyError:
except (TypeError, KeyError):
return False

@property
Expand Down Expand Up @@ -592,7 +592,7 @@ def available(self) -> bool:

return super().available

except KeyError:
except (TypeError, KeyError):
return False

@property
Expand Down

0 comments on commit aa16ca9

Please sign in to comment.