Skip to content

Commit

Permalink
[miio] change brightness for Philips bulbs (#7349)
Browse files Browse the repository at this point in the history
* [miio] change brightness for Philips bulbs

add s6 vacuum

* [miio] fix Philips light
* [miio] remove non existent type
* [miio] update philips lights

Signed-off-by: Marcel Verpaalen <marcel@verpaalen.com>
  • Loading branch information
marcelrv authored Apr 13, 2020
1 parent 715322a commit b19b0b2
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 88 deletions.
109 changes: 45 additions & 64 deletions bundles/org.openhab.binding.miio/README.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public enum MiIoDevices {
VACUUMST7PV3("roborock.vacuum.t7pv3", "Roborock Vacuum T7 v3", THING_TYPE_VACUUM),
VACUUMS5MAX("roborock.vacuum.s5e", "Roborock Vacuum S5 Max", THING_TYPE_VACUUM),
VACUUMSS6("rockrobo.vacuum.s6", "Roborock Vacuum S6", THING_TYPE_VACUUM),
VACUUMSS62("roborock.vacuum.s6", "Roborock Vacuum S6", THING_TYPE_VACUUM),
VACUUME2("roborock.vacuum.e2", "Rockrobo Xiaowa Vacuum v2", THING_TYPE_UNSUPPORTED),
VACUUME_V6("viomi.vacuum.v6", "Xiaomi Mijia vacuum V-RVCLM21B", THING_TYPE_UNSUPPORTED),
VACUUME_V7("viomi.vacuum.v7", "Xiaomi Mijia vacuum STYJ02YM", THING_TYPE_UNSUPPORTED),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.eclipse.smarthome.core.library.types.DecimalType;
import org.eclipse.smarthome.core.library.types.HSBType;
import org.eclipse.smarthome.core.library.types.OnOffType;
import org.eclipse.smarthome.core.library.types.PercentType;
import org.eclipse.smarthome.core.library.types.StringType;
import org.eclipse.smarthome.core.thing.Channel;
import org.eclipse.smarthome.core.thing.ChannelUID;
Expand Down Expand Up @@ -404,6 +405,9 @@ private void updateChannel(@Nullable MiIoBasicChannel basicChannel, String param
case "number":
updateState(basicChannel.getChannel(), new DecimalType(val.getAsBigDecimal()));
break;
case "dimmer":
updateState(basicChannel.getChannel(), new PercentType(val.getAsBigDecimal()));
break;
case "string":
updateState(basicChannel.getChannel(), new StringType(val.getAsString()));
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"id": [
"philips.light.bulb",
"philips.light.downlight",
"philips.light.mono1",
"philips.light.virtual",
"philips.light.zysread",
"philips.light.zystrip"
Expand All @@ -27,7 +26,7 @@
"property": "bright",
"friendlyName": "Brightness",
"channel": "brightness",
"type": "Number",
"type": "Dimmer",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
Expand All @@ -41,7 +40,7 @@
"property": "cct",
"friendlyName": "Correlated Color Temperature",
"channel": "cct",
"type": "Number",
"type": "Dimmer",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
Expand Down Expand Up @@ -105,20 +104,6 @@
"parameterType": "NUMBER"
}
]
},
{
"property": "",
"friendlyName": "Toggle",
"channel": "toggle",
"type": "Switch",
"refresh": false,
"ChannelGroup": "actions",
"actions": [
{
"command": "toggle",
"parameterType": "EMPTY"
}
]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"property": "bright",
"friendlyName": "Brightness",
"channel": "brightness",
"type": "Number",
"type": "Dimmer",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
Expand All @@ -37,7 +37,7 @@
"property": "cct",
"friendlyName": "Correlated Color Temperature",
"channel": "cct",
"type": "Number",
"type": "Dimmer",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"property": "bright",
"friendlyName": "Brightness",
"channel": "brightness",
"type": "Number",
"type": "Dimmer",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
Expand All @@ -37,7 +37,7 @@
"property": "cct",
"friendlyName": "Correlated Color Temperature",
"channel": "cct",
"type": "Number",
"type": "Dimmer",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"deviceMapping": {
"id": [
"philips.light.mono1"
],
"channels": [
{
"property": "power",
"friendlyName": "Power",
"channel": "power",
"type": "Switch",
"refresh": true,
"ChannelGroup": "",
"actions": [
{
"command": "set_power",
"parameterType": "ONOFF"
}
]
},
{
"property": "bright",
"friendlyName": "Brightness",
"channel": "brightness",
"type": "Dimmer",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "set_bright",
"parameterType": "NUMBER"
}
]
},
{
"property": "scene_num",
"friendlyName": "Scene",
"channel": "scene",
"type": "Number",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
{
"command": "set_user_scene",
"parameterType": "NUMBER"
}
]
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"property": "bright",
"friendlyName": "Brightness",
"channel": "brightness",
"type": "Number",
"type": "Dimmer",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
Expand All @@ -36,7 +36,7 @@
"property": "cct",
"friendlyName": "Correlated Color Temperature",
"channel": "cct",
"type": "Number",
"type": "Dimmer",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"property": "bright",
"friendlyName": "Brightness",
"channel": "brightness",
"type": "Number",
"type": "Dimmer",
"refresh": true,
"ChannelGroup": "actions",
"actions": [
Expand Down

1 comment on commit b19b0b2

@jbusuttil83
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this update breaks functionality of Brightness of Xiaomi Philips Bulb

Please sign in to comment.