Closed seydx closed 3 years ago
show us the bash file
I am not sure if it is related but there is a bug in the code that I have found. This bug only occurs when using Polling mode AND the command throws an error.
For example when using ps4-waker: PS4 State = REST, ps4-waker = FOUND, status = OFF (correct) PS4 State = ON, ps4-waker = FOUND, status = ON (correct) PS4 State = OFF, ps4-waker = ERROR, status = whatever it was previously (incorrect)
According to the docs, this plugin is supposed to set the device as off in the case of an error, however, what it actually does is just use the previous value from the cache.
This is due to differences in how the state is determined when using polling or not. The correct way can be found when polling is off:
However, the error can be seen here (line 182):
The important part is that during polling, the state is only updated if there was no error. This can be easily fixed by changing it to if (state !== thisSwitch.state) {
. The bug causes the device to constantly display whatever state the device was in before the last error, regardless to response.
Hey everyone,
i have an issue with the state/polling of my tv. I created a bash file to get the status of my tv (on/standby) with curl. If i turn off the tv (standby), it disconnects from the internet after certain time and HomeKit tells me that the tv is offline. So far so good.
But if i turn it on with my script (i am using broadlink rm to turn it on if there is no internet connection, but if the tv is still connected with internet i am using curl to turn it on ) the tv will turn on. BUT the state of my tv goes offline and after 1-2 sec it goes online again... This happens several times before it stays online..
It only happens by reconnecting the tv with internet..
Can anyone help me?