Skip to content

Commit

Permalink
add firmware checks
Browse files Browse the repository at this point in the history
  • Loading branch information
matt8707 committed Mar 6, 2021
1 parent cd5e219 commit 4f22d86
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
34 changes: 33 additions & 1 deletion include/sensor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,30 @@ sensor:
display_options:
['time', 'date']

- platform: mqtt
name: valetudo_version_installed
state_topic: homeassistant/vacuum/valetudo_robot/config
value_template: >
{{ value_json.device.sw_version.split(' ')[0] }}
- platform: rest
name: valetudo_version_latest
resource: https://api.github.com/repos/Hypfer/Valetudo/releases/latest
value_template: '{{ value_json.tag_name }}'
scan_interval: 86400

- platform: mqtt
name: tasmota_version_installed
state_topic: tasmota/discovery/C44F33B95EBA/config
value_template: >
{{ value_json.sw }}
- platform: rest
name: tasmota_version_latest
resource: https://api.github.com/repos/arendst/Tasmota/releases/latest
value_template: '{{ value_json.tag_name.split("v")[1] }}'
scan_interval: 86400

- platform: rest
name: covid_19_folkhalsomyndigheten
resource: https://www.arcgis.com/sharing/rest/content/items/2dc63e26f509468f896ec69476b0dab3/data
Expand Down Expand Up @@ -398,7 +422,15 @@ sensor:
hass_dev_release:
icon_template: mdi:dev-to
friendly_name: Kommande release
friendly_name_template: >
{% set release = state_attr('calendar.home_assistant_devs','message') %}
{% if release == 'Home Assistant Core Beta Release' %}
Nästa beta
{% elif release == 'Home Assistant Core Release' %}
Nästa release
{% else %}
{{ release }}
{% endif %}
device_class: timestamp
value_template: >
{{ state_attr('calendar.home_assistant_devs', 'start_time') | replace(' ','T') }}
Expand Down
22 changes: 22 additions & 0 deletions popup/sidebar_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
}
entities:

### home assistant

- type: custom:hui-element
card_type: markdown
content: >
Expand Down Expand Up @@ -108,6 +110,8 @@
]]]
template: icon_name

### hacs

- type: custom:hui-element
card_type: markdown
content: >
Expand Down Expand Up @@ -151,3 +155,21 @@
border-radius: 0 0 1em 1em;
}
template: icon_name

### other

- type: custom:hui-element
card_type: markdown
content: >
{% set tasmota_installed = states('sensor.tasmota_version_installed') %}
{% set tasmota_latest = states('sensor.tasmota_version_latest') %}
{% set valetudo_installed = states('sensor.valetudo_version_installed') %}
{% set valetudo_latest = states('sensor.valetudo_version_latest') %}
<span><ha-icon icon="mdi:update"></ha-icon> Övrigt</span><br>
{% if tasmota_installed == tasmota_latest and valetudo_installed == valetudo_latest %}
<b>Inga uppdateringar</b>
{% else %}
{{ '[<b>Tasmota ' + tasmota_latest + '](https://github.com/arendst/Tasmota/releases/latest) tillgänglig</b> ' + '\U0001f389' if tasmota_installed != tasmota_latest }}
{{ '[<b>Valetudo ' + valetudo_latest + '](https://github.com/Hypfer/Valetudo/releases/latest) tillgänglig</b> ' + '\U0001f389' if valetudo_installed != valetudo_latest }}
{% endif %}

0 comments on commit 4f22d86

Please sign in to comment.