Hi All,
I have an Item defined as follows:
Switch Gate "Front Gate" [ "Lighting" ] {mqtt=">[brokerHome:/topics/sonoff/one:command:off:0],>[broker:/topics/sonoff/one:command:on:1]"}
In HabPanel i have a custom switch defined using ng-mousedown and ng-mouseup, my issue is that it seems a finger touch screen “touch” does not behave the same as a mouse click.
<div ng-init='onoff={"name": "OnOff", "item": config.light, "hidelabel": true, "hideonoff": true, "iconset": "smarthome-set","icon": "bulb","icon_size": "36" }'>
<widget-switch ng-model="onoff" ng-mousedown="sendCmd(config.light, 'ON')" ng-mouseup="sendCmd(config.light, 'OFF')"/>
<!--<widget-switch ng-model="onoff" ng-touchstart="sendCmd(config.light, 'ON')" ng-touchend="sendCmd(config.light, 'OFF')"/> -->
</div>
I have tried to use the ng-touch function, however it seems to give the same issues.
Basically what i’m trying to achieve is that when the button is touched it must send the on command, and when it is released it sends the off command, basically a momentary switch.
Any better ideas to get the button to reset when you lift your finger?
Just to elaborate a bit more, using a mouse works 100% as expected, using a finger / touch the panel does not recognize that I’ve lifted my finger so “mouseup” never fires.