From c9dbc46fd183d115ed59d2261dfd83b4fe57584c Mon Sep 17 00:00:00 2001 From: Marcel Date: Tue, 26 Jan 2021 05:15:26 +0100 Subject: [PATCH] [miio] use json db to drive temperature channel definitions (#9960) Signed-off-by: Marcel Verpaalen --- .../main/resources/database/cgllc.airmonitor.s1.json | 5 ++++- .../src/main/resources/database/chuangmi.plug.m1.json | 5 ++++- .../src/main/resources/database/chuangmi.plug.v3.json | 5 ++++- .../main/resources/database/chuangmi.plug.v3fw.json | 5 ++++- .../main/resources/database/yunmi.waterpurifier.json | 5 ++++- .../main/resources/database/zhimi.airpurifier.m1.json | 5 ++++- .../main/resources/database/zhimi.airpurifier.v6.json | 5 ++++- .../main/resources/database/zhimi.airpurifier.v7.json | 5 ++++- .../src/main/resources/database/zhimi.heater.za1.json | 10 ++++++++-- .../main/resources/database/zhimi.heater.za2-miot.json | 5 ++++- .../main/resources/database/zhimi.heater.zb1-miot.json | 5 ++++- .../main/resources/database/zhimi.humidifier.ca4.json | 5 ++++- .../main/resources/database/zhimi.humidifier.cb1.json | 5 ++++- .../main/resources/database/zhimi.humidifier.v1.json | 5 ++++- .../main/resources/database/zimi.powerstrip.v2.json | 5 ++++- 15 files changed, 64 insertions(+), 16 deletions(-) diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/cgllc.airmonitor.s1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/cgllc.airmonitor.s1.json index 773678e9df..99d2f2d2b7 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/cgllc.airmonitor.s1.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/cgllc.airmonitor.s1.json @@ -73,9 +73,12 @@ "property": "temperature", "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "ChannelGroup": "Status", "actions": [], diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.m1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.m1.json index e588f51ca5..a4ac285faa 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.m1.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.m1.json @@ -28,9 +28,12 @@ "property": "temperature", "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "actions": [], "category": "temperature", diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3.json b/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3.json index f3e300e00f..1316189f2b 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3.json @@ -41,9 +41,12 @@ "property": "temperature", "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "actions": [], "category": "temperature", diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3fw.json b/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3fw.json index da0b92b399..1999d01a2b 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3fw.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/chuangmi.plug.v3fw.json @@ -45,9 +45,12 @@ "property": "temperature", "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "actions": [], "category": "temperature", diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/yunmi.waterpurifier.json b/bundles/org.openhab.binding.miio/src/main/resources/database/yunmi.waterpurifier.json index 2cbcfaab6c..6318b25f60 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/yunmi.waterpurifier.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/yunmi.waterpurifier.json @@ -29,9 +29,12 @@ "property": "temperature", "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "actions": [], "category": "temperature", diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.m1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.m1.json index 26d62f5e07..f3681abfb8 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.m1.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.m1.json @@ -295,9 +295,12 @@ "property": "temp_dec", "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "transformation": "/10", "ChannelGroup": "Status", diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v6.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v6.json index 844fd5414a..2ce35575a5 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v6.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v6.json @@ -190,9 +190,12 @@ "property": "temp_dec", "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "transformation": "/10", "ChannelGroup": "Status", diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v7.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v7.json index 66daf74691..c285badc75 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v7.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.airpurifier.v7.json @@ -189,9 +189,12 @@ "property": "temp_dec", "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "transformation": "/10", "ChannelGroup": "Status", diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.za1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.za1.json index 72856cb47e..6c60317f43 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.za1.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.za1.json @@ -28,9 +28,12 @@ "property": "target_temperature", "friendlyName": "Target Temperature", "channel": "target_temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "actions": [ { @@ -120,9 +123,12 @@ "property": "temperature", "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "actions": [], "category": "temperature", diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.za2-miot.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.za2-miot.json index dff70276db..46f853218a 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.za2-miot.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.za2-miot.json @@ -114,9 +114,12 @@ "piid": 8, "friendlyName": "Environment - Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "actions": [], "category": "temperature", diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.zb1-miot.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.zb1-miot.json index b46372dda3..e9d63466af 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.zb1-miot.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.heater.zb1-miot.json @@ -114,9 +114,12 @@ "piid": 8, "friendlyName": "Environment - Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "actions": [], "category": "temperature", diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.ca4.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.ca4.json index 7aa538777f..9f89eab620 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.ca4.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.ca4.json @@ -220,9 +220,12 @@ "piid": 7, "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "ChannelGroup": "Status", "actions": [], diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.cb1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.cb1.json index b8240984dd..f24a7a31dc 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.cb1.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.cb1.json @@ -151,9 +151,12 @@ "property": "temperature", "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "ChannelGroup": "Status", "actions": [], diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.v1.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.v1.json index 5ac1e8f645..0aa9b347bf 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.v1.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zhimi.humidifier.v1.json @@ -175,9 +175,12 @@ "property": "temp_dec", "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "transformation": "/10", "ChannelGroup": "Status", diff --git a/bundles/org.openhab.binding.miio/src/main/resources/database/zimi.powerstrip.v2.json b/bundles/org.openhab.binding.miio/src/main/resources/database/zimi.powerstrip.v2.json index 54979f86a4..f307890e28 100644 --- a/bundles/org.openhab.binding.miio/src/main/resources/database/zimi.powerstrip.v2.json +++ b/bundles/org.openhab.binding.miio/src/main/resources/database/zimi.powerstrip.v2.json @@ -76,9 +76,12 @@ "property": "temperature", "friendlyName": "Temperature", "channel": "temperature", - "channelType": "temperatureC", "type": "Number:Temperature", "unit": "CELCIUS", + "stateDescription": { + "pattern": "%.1f %unit%", + "readOnly": true + }, "refresh": true, "actions": [], "category": "temperature", -- 2.47.3