Closed mriksman closed 7 years ago
Also needed to add the fix for the leakSMART valve which detects as a binary_switch
, but uses opened
, not powered
.
const isValve = (state, device, config) => state.opened != undefined;
const isLightBulb = (state, device, config) => !isFan(state, device, config) &&
!isOutlet(state, device, config) &&
!isSwitch(state, device, config) &&
!isValve(state, device, config);
}, {
service: Service.Switch,
supported: isValve,
characteristics: [{
characteristic: Characteristic.On,
get: state => state.opened,
set: value => ({ opened: !!value })
}]
I think all these fixes are now included in 1.7.0
Only the Outlink supports
consumption
in Wink. But you could have abinary_switch
that is connected to an outlet. In this case, the device wouldn't haveconsumption
. Because of this, there needs to be a manual way to set abinary_switch
as anoutlet
.I have modified the const declarations up the top to;
So an Outlet can be manually defined, or it can look for the
consumption
property. It also needs a slight modification to the 'Outlet in Use' property;If a
binary_switch
is defined as aService.Outlet
, then you can change the type within Home to;If a
binary_switch
is defined as aService.Switch
, then you can change the type within Home to;Which means that, you don't really need to identify a fan. You could just identify it as an Outlet or a Switch, and modify the type within the Home app.