diff --git a/app/triggers/providers/mqtt/Hass.js b/app/triggers/providers/mqtt/Hass.js index d8deb404..30bddbc5 100644 --- a/app/triggers/providers/mqtt/Hass.js +++ b/app/triggers/providers/mqtt/Hass.js @@ -1,4 +1,3 @@ -const capitalize = require('capitalize'); const { getVersion } = require('../../../configuration'); const { registerContainerAdded, @@ -10,8 +9,8 @@ const { const containerStore = require('../../../store/container'); const HASS_DEVICE_ID = 'wud'; -const HASS_DEVICE_NAME = 'What\'s up Docker?'; -const HASS_MANUFACTURER = 'fmartinou'; +const HASS_DEVICE_NAME = 'wud'; +const HASS_MANUFACTURER = 'wud'; const HASS_ENTITY_VALUE_TEMPLATE = '{{ value_json.image_tag_value }}'; const HASS_LATEST_VERSION_TEMPLATE = '{% if value_json.update_kind_kind == "digest" %}{{ value_json.result_digest[:15] }}{% else %}{{ value_json.result_tag }}{% endif %}'; @@ -31,9 +30,9 @@ function getHassEntityId(topic) { function getHaDevice() { return { identifiers: [HASS_DEVICE_ID], - manufacturer: capitalize(HASS_MANUFACTURER), - model: capitalize(HASS_DEVICE_ID), - name: capitalize(HASS_DEVICE_NAME), + manufacturer: HASS_MANUFACTURER, + model: HASS_DEVICE_ID, + name: HASS_DEVICE_NAME, sw_version: getVersion(), }; } diff --git a/app/triggers/providers/mqtt/Hass.test.js b/app/triggers/providers/mqtt/Hass.test.js index c11e03fb..2cac865c 100644 --- a/app/triggers/providers/mqtt/Hass.test.js +++ b/app/triggers/providers/mqtt/Hass.test.js @@ -37,9 +37,9 @@ test('publishDiscoveryMessage must publish a discovery message expected by HA', name: 'My state', device: { identifiers: ['wud'], - manufacturer: 'WUD', - model: 'WUD', - name: 'WUD', + manufacturer: 'wud', + model: 'wud', + name: 'wud', sw_version: 'unknown', }, icon: 'mdi:docker', @@ -63,9 +63,9 @@ test('addContainerSensor must publish sensor discovery message expected by HA', identifiers: [ 'wud', ], - manufacturer: 'WUD', - model: 'WUD', - name: 'WUD', + manufacturer: 'wud', + model: 'wud', + name: 'wud', sw_version: 'unknown', }, icon: 'mdi:docker', @@ -101,7 +101,7 @@ test('updateContainerSensors must publish all sensors expected by HA', async () object_id: 'topic_total_count', name: 'Total container count', device: { - identifiers: ['wud'], manufacturer: 'WUD', model: 'WUD', name: 'WUD', sw_version: 'unknown', + identifiers: ['wud'], manufacturer: 'wud', model: 'wud', name: 'wud', sw_version: 'unknown', }, icon: 'mdi:docker', entity_picture: 'https://github.com/getwud/wud/raw/main/docs/wud_logo.png', @@ -113,7 +113,7 @@ test('updateContainerSensors must publish all sensors expected by HA', async () object_id: 'topic_update_count', name: 'Total container update count', device: { - identifiers: ['wud'], manufacturer: 'WUD', model: 'WUD', name: 'WUD', sw_version: 'unknown', + identifiers: ['wud'], manufacturer: 'wud', model: 'wud', name: 'wud', sw_version: 'unknown', }, icon: 'mdi:docker', entity_picture: 'https://github.com/getwud/wud/raw/main/docs/wud_logo.png', @@ -125,7 +125,7 @@ test('updateContainerSensors must publish all sensors expected by HA', async () object_id: 'topic_update_status', name: 'Total container update status', device: { - identifiers: ['wud'], manufacturer: 'WUD', model: 'WUDWud', name: 'WUD', sw_version: 'unknown', + identifiers: ['wud'], manufacturer: 'wud', model: 'wud', name: 'wud', sw_version: 'unknown', }, icon: 'mdi:docker', entity_picture: 'https://github.com/getwud/wud/raw/main/docs/wud_logo.png', @@ -139,7 +139,7 @@ test('updateContainerSensors must publish all sensors expected by HA', async () object_id: 'topic_watcher-name_total_count', name: 'Watcher watcher-name container count', device: { - identifiers: ['wud'], manufacturer: 'WUD', model: 'WUD', name: 'WUD', sw_version: 'unknown', + identifiers: ['wud'], manufacturer: 'wud', model: 'wud', name: 'wud', sw_version: 'unknown', }, icon: 'mdi:docker', entity_picture: 'https://github.com/getwud/wud/raw/main/docs/wud_logo.png', @@ -151,7 +151,7 @@ test('updateContainerSensors must publish all sensors expected by HA', async () object_id: 'topic_watcher-name_update_count', name: 'Watcher watcher-name container update count', device: { - identifiers: ['wud'], manufacturer: 'WUD', model: 'WUD', name: 'WUD', sw_version: 'unknown', + identifiers: ['wud'], manufacturer: 'wud', model: 'wud', name: 'wud', sw_version: 'unknown', }, icon: 'mdi:docker', entity_picture: 'https://github.com/getwud/wud/raw/main/docs/wud_logo.png', @@ -163,7 +163,7 @@ test('updateContainerSensors must publish all sensors expected by HA', async () object_id: 'topic_watcher-name_update_status', name: 'Watcher watcher-name container update status', device: { - identifiers: ['wud'], manufacturer: 'WUD', model: 'WUD', name: 'WUD', sw_version: 'unknown', + identifiers: ['wud'], manufacturer: 'wud', model: 'wud', name: 'wud', sw_version: 'unknown', }, icon: 'mdi:docker', entity_picture: 'https://github.com/getwud/wud/raw/main/docs/wud_logo.png', @@ -204,7 +204,7 @@ test('updateWatcherSensors must publish all watcher sensor messages expected by object_id: 'topic_watcher-name_running', name: 'Watcher watcher-name running status', device: { - identifiers: ['wud'], manufacturer: 'WUD', model: 'WUD', name: 'WUD', sw_version: 'unknown', + identifiers: ['wud'], manufacturer: 'wud', model: 'wud', name: 'wud', sw_version: 'unknown', }, icon: 'mdi:docker', entity_picture: 'https://github.com/getwud/wud/raw/main/docs/wud_logo.png',