mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-28 22:39:52 +00:00
fix: Home Assistant: add is_updating attribute (#26231)
This commit is contained in:
@@ -1411,7 +1411,7 @@ export default class HomeAssistant extends Extension {
|
||||
entity_category: 'config',
|
||||
command_topic: `${settings.get().mqtt.base_topic}/bridge/request/device/ota_update/update`,
|
||||
payload_install: `{"id": "${entity.ieeeAddr}"}`,
|
||||
value_template: `{"latest_version":"{{ value_json['update']['latest_version'] }}","installed_version":"{{ value_json['update']['installed_version'] }}","update_percentage":{{ value_json['update'].get('progress', 'null') }}}`,
|
||||
value_template: `{"latest_version":"{{ value_json['update']['latest_version'] }}","installed_version":"{{ value_json['update']['installed_version'] }}","update_percentage":{{ value_json['update'].get('progress', 'null') }},"is_updating":{{ value_json['update']['state'] == 'updating' }}}`,
|
||||
},
|
||||
};
|
||||
configs.push(updateSensor);
|
||||
|
||||
@@ -1681,7 +1681,7 @@ describe('Extension: HomeAssistant', () => {
|
||||
state_topic: 'zigbee2mqtt/bulb',
|
||||
unique_id: '0x000b57fffec6a5b2_update_zigbee2mqtt',
|
||||
value_template:
|
||||
"{\"latest_version\":\"{{ value_json['update']['latest_version'] }}\",\"installed_version\":\"{{ value_json['update']['installed_version'] }}\",\"update_percentage\":{{ value_json['update'].get('progress', 'null') }}}",
|
||||
"{\"latest_version\":\"{{ value_json['update']['latest_version'] }}\",\"installed_version\":\"{{ value_json['update']['installed_version'] }}\",\"update_percentage\":{{ value_json['update'].get('progress', 'null') }},\"is_updating\":{{ value_json['update']['state'] == 'updating' }}}",
|
||||
};
|
||||
|
||||
expect(mockMQTTPublishAsync).toHaveBeenCalledWith('homeassistant/update/0x000b57fffec6a5b2/update/config', stringify(payload), {
|
||||
|
||||
Reference in New Issue
Block a user