Closed joelw135 closed 6 years ago
Hiya - I just finally paired my old (original) Xiaomi - using iOS. I notice that when I have it set to momentary - it will occasionally hang on pushed if I'm pushing it a lot and fast. Most of the time it's fine though (switches back to released). If I have it set to toggle - if I press it it stays pushed, if I press it again it goes to release, and on and on - but that's kind of what I'd expect for a toggle, no (two states?).
Mine when set to toggle always stays pushed, and if pressed does nothing. I just tried it in momentary, and does the same thing. Nothing.. The one from the other developer works. But Brian's battery and advanced setting are much better. I hope it can be fixed.
Wow - that's a bummer! When on toggle my original button stays on 'pushed' until I press it (the physical switch, not the app) and then it releases. Wonder what the difference could be? (I'm also on iOS)
On Mon, Jan 29, 2018 at 4:59 PM, joelw135 notifications@github.com wrote:
Mine when set to toggle always stays pushed, and if pressed does nothing.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bspranger/Xiaomi/issues/64#issuecomment-361401365, or mute the thread https://github.com/notifications/unsubscribe-auth/AC5P19yu8sT6WYnORPcXEAoqK7kLfIIXks5tPj9fgaJpZM4RwiIp .
-- Alec McLure, MPH, RHIA, CCS-P Cell: +1 401-663-1316 Email: alecdjm@gmail.com
I just tried again. Changed to the DTH the button says pushed, went to the physical button pressed it and the lights went on but the button for the DTH stays pushed. Only thing that changes is the last push shows on the right of the battery. Not very convenient, as I sometimes turn on that group form the DTH. I think something happened to the code when transferred from the original DTH.
can anyone test the pull #65 it fixes the virtual button but the button will always say push instead.
I don't personally care about the released stuff, I have removed all of that from my modified code my "private Map parseCustomMessage" look like this. seems to make the button more reliable and just scrap the held part of the buttons
private Map parseCustomMessage(String description) { def result = [:] if (description?.startsWith('on/off: ')) { if (description == 'on/off: 0'){ result = getContactResult("pushed") } return result } }
@tmleafs If you tell me where exactly to place this in the code, I will gladly test this.
well the true fix is just add this
capability "Momentary"
to the capabilities the rest of the pull request is fixing other bugs and things that annoy me
@tmleafs I don't see where in the code. Give me a hint.
where is says
capability "Sensor" capability "Refresh"
And this after
capability "Momentary"
@tmleafs I found it, put it in but still stays pushed unless you got to the device itself and press it. It should work just from the DTH in the app.
it will say pushed but pressing it will work
OK, so no way to get it to say released, unless you do it from the physical button.
There has to be a more elegant way. If it works in @a4refillpad DTH why can't we make it work in this?
I have sorted it the latest pull request matches smartthings standards of a momentary button https://github.com/SmartThingsCommunity/SmartThingsPublic/blob/master/devicetypes/smartthings/momentary-button-tile.src/momentary-button-tile.groovy
@tmleafs OK Steve, then if Brian or one of the other developers writes the momentary code into the DTH for the button it should work? Is that correct?
you happy with this? https://www.youtube.com/watch?v=S8AnemCGfH4
@tmleafs Of course, as that is how it should work. I am a perfectionist, and if something isn't correct, I am like a dog with a bone.
I merged the changes
Thank you Steve & Brian, nice seeing it working as it should. I am elated.
Fixed
Would you please look at the problem with the Original button where it shows always pushed. It works with the original code on the other thread.