forked from home-assistant/core
Fix zwave_js firmware update logic (#101143)
* Fix zwave_js firmware update logic * add comment * tweak implementation for ssame outcome
This commit is contained in:
@@ -211,11 +211,15 @@ class ZWaveNodeFirmwareUpdate(UpdateEntity):
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
available_firmware_updates = (
|
# Retrieve all firmware updates including non-stable ones but filter
|
||||||
await self.driver.controller.async_get_available_firmware_updates(
|
# non-stable channels out
|
||||||
self.node, API_KEY_FIRMWARE_UPDATE_SERVICE
|
available_firmware_updates = [
|
||||||
|
update
|
||||||
|
for update in await self.driver.controller.async_get_available_firmware_updates(
|
||||||
|
self.node, API_KEY_FIRMWARE_UPDATE_SERVICE, True
|
||||||
)
|
)
|
||||||
)
|
if update.channel == "stable"
|
||||||
|
]
|
||||||
except FailedZWaveCommand as err:
|
except FailedZWaveCommand as err:
|
||||||
LOGGER.debug(
|
LOGGER.debug(
|
||||||
"Failed to get firmware updates for node %s: %s",
|
"Failed to get firmware updates for node %s: %s",
|
||||||
|
@@ -87,6 +87,24 @@ FIRMWARE_UPDATES = {
|
|||||||
"rfRegion": 1,
|
"rfRegion": 1,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
# This firmware update should never show because it's in the beta channel
|
||||||
|
{
|
||||||
|
"version": "999.999.999",
|
||||||
|
"changelog": "blah 3",
|
||||||
|
"channel": "beta",
|
||||||
|
"files": [
|
||||||
|
{"target": 0, "url": "https://example3.com", "integrity": "sha3"}
|
||||||
|
],
|
||||||
|
"downgrade": True,
|
||||||
|
"normalizedVersion": "999.999.999",
|
||||||
|
"device": {
|
||||||
|
"manufacturerId": 1,
|
||||||
|
"productType": 2,
|
||||||
|
"productId": 3,
|
||||||
|
"firmwareVersion": "0.4.4",
|
||||||
|
"rfRegion": 1,
|
||||||
|
},
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user