Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle available TypeError in number platform #467

Merged
merged 1 commit into from
Nov 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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