Skip to content

Commit

Permalink
Remove zha from dependencies because backup bug #1323
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Apr 8, 2024
1 parent 07e0a18 commit 91a24ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions custom_components/xiaomi_gateway3/core/ezsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,18 +97,22 @@ async def update_zigbee_firmware(hass: HomeAssistant, host: str, custom: bool):


async def read_firmware(host: str) -> Optional[str]:
from bellows.ezsp import EZSP

ezsp = EZSP({"path": f"socket://{host}:8889", "baudrate": 0, "flow_control": None})
ezsp = None
try:
from bellows.ezsp import EZSP

ezsp = EZSP(
{"path": f"socket://{host}:8889", "baudrate": 0, "flow_control": None}
)
await ezsp.connect(use_thread=False)
await ezsp.startup_reset()
_, _, version = await ezsp.get_board_info()
except Exception as e:
_LOGGER.debug(f"{host} [FWUP] Read firmware error: {e}")
return None
finally:
ezsp.close()
if ezsp:
ezsp.close()

_LOGGER.debug(f"{host} [FWUP] Current zigbee firmware v{version}")

Expand Down
2 changes: 1 addition & 1 deletion custom_components/xiaomi_gateway3/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
],
"config_flow": true,
"dependencies": [
"zha"
],
"documentation": "https://github.com/AlexxIT/XiaomiGateway3",
"iot_class": "local_push",
"issue_tracker": "https://github.com/AlexxIT/XiaomiGateway3/issues",
"requirements": [
"zigpy>=0.52.3"
],
"version": "4.0.3"
}

0 comments on commit 91a24ef

Please sign in to comment.