diff --git a/.homeychangelog.json b/.homeychangelog.json index fa18f90..0bedda4 100644 --- a/.homeychangelog.json +++ b/.homeychangelog.json @@ -594,6 +594,10 @@ "1.6.2": { "en": "Small technical fixes.", "de": "Kleine technische Korrekturen." + }, + "1.6.3": { + "en": "Added decimals parameter for manually added entities.", + "de": "Dezimalstellen-Parameter für manuell hinzugefügte Entitäten ergänzt." } } diff --git a/.homeycompose/app.json b/.homeycompose/app.json index b998049..3424de7 100644 --- a/.homeycompose/app.json +++ b/.homeycompose/app.json @@ -1,6 +1,6 @@ { "id": "io.home-assistant.community", - "version": "1.6.2", + "version": "1.6.3", "compatibility": ">=8.1.0", "sdk": 3, "brandColor": "#0DA6EA", diff --git a/.homeycompose/drivers/repair/add_entity/index.html b/.homeycompose/drivers/repair/add_entity/index.html index 1f0d03b..893be27 100644 --- a/.homeycompose/drivers/repair/add_entity/index.html +++ b/.homeycompose/drivers/repair/add_entity/index.html @@ -44,6 +44,7 @@ capability: document.getElementById('capabilityAdd').value, name: document.getElementById('nameAdd').value, unit: document.getElementById('unitAdd').value, + decimals: document.getElementById('decimalsAdd').value, converter_ha2homey: document.getElementById('converter_ha2homeyAdd').value, converter_homey2ha: document.getElementById('converter_homey2haAdd').value, add_as_main_capability: document.getElementById('addAsMainCapabilityAdd').checked, @@ -137,7 +138,18 @@ } ); } - + function onInfoDecimals(){ + let message = new InfoMessage(); + message.info( + Homey.__("repair.custom_device.info_decimals"), + { + duration: 0, + closable: true, + dangerUseHtml: true + } + ); + } + function onAddEntityAttributeClick(){ if (document.getElementById("addEntityAttributeAdd").checked){ document.getElementById("labelEntityAttributeAdd").style.display = 'unset'; @@ -174,6 +186,27 @@ } } + function onCapabilityChanged(){ + decimalsVisibility(); + } + + function decimalsVisibility(){ + document.getElementById('decimalsAdd').value = ''; + let capability = document.getElementById('capabilityAdd').value; + if ( + (capability.startsWith('measure') || capability.startsWith('meter')) + && + !capability.startsWith('measure_generic')){ + document.getElementById("divNumberDecimal").style.display = 'unset'; + } + else{ + document.getElementById("divNumberDecimal").style.display = 'none'; + } + } + + // update decimal value field + decimalsVisibility(); + // update visible/invisible fields onAddEntityAttributeClick(); @@ -216,7 +249,7 @@
- +
@@ -233,6 +266,17 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +