Improve typing of deCONZ diagnostics (#69491)

* Improve typing of deCONZ diagnostics

homeassistant/components/deconz/diagnostics.py:28: error: Item "None" of "Optional[WSClient]" has no attribute "state"  [union-attr]
homeassistant/components/deconz/diagnostics.py:40: error: Unpacking a string is disallowed  [misc]
homeassistant/components/deconz/diagnostics.py:40: error: Cannot determine type of "k"  [has-type]
homeassistant/components/deconz/diagnostics.py:40: error: Cannot determine type of "v"  [has-type]
homeassistant/components/deconz/diagnostics.py:42: error: Unpacking a string is disallowed  [misc]
homeassistant/components/deconz/diagnostics.py:42: error: Cannot determine type of "k"  [has-type]
homeassistant/components/deconz/diagnostics.py:42: error: Cannot determine type of "v"  [has-type]

* Fix review comments

* These mypy ignores arent useful until py.typed is introduced with the library which I will do once I resolve as much as possible in the integration
pull/70068/head
Robert Svensson 2022-04-14 23:04:32 +02:00 committed by GitHub
parent 459d775ad5
commit c920d7d5e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -25,7 +25,9 @@ async def async_get_config_entry_diagnostics(
diag["deconz_config"] = async_redact_data(
gateway.api.config.raw, REDACT_DECONZ_CONFIG
)
diag["websocket_state"] = gateway.api.websocket.state
diag["websocket_state"] = (
gateway.api.websocket.state if gateway.api.websocket else "Unknown"
)
diag["deconz_ids"] = gateway.deconz_ids
diag["entities"] = gateway.entities
diag["events"] = {