ivootjuh schreef op woensdag 18 september 2019 @ 22:50:
[...]
Ik heb .checkFirst() weggehaald na de .dimTo(5) en het klopt inderdaad dat de foutmelding nu weg is.
Ik vraag me alleen af of het dan altijd goed gaat. Want logischerwijs controleert hij met de .checkFirst() eerst of de lamp in dit geval al op 5 procent staat? of begrijp ik het dan verkeerd?
Mij lijkt dat je dit stukje code er toch in wilt hebben.....
Je script wordt een stuk langer wil je gaan kijken of de lamp al brand, ik zou dat stuk lekker achterwegen latencheckFirst(): Function. Checks if the current state of the device is different than the desired new state. If the target state is the same, no command is sent. If you do mySwitch.switchOn().checkFirst(), then no switch command is sent if the switch is already on. This command only works with switch-like devices. It is not available for toggle and dim commands, either.
Donstil: Je moet kopen wat je wilt hebben. Niet wat je nodig hebt!