Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

state changes after restart #38

Open
p4co86 opened this issue Dec 22, 2015 · 7 comments
Open

state changes after restart #38

p4co86 opened this issue Dec 22, 2015 · 7 comments

Comments

@p4co86
Copy link

p4co86 commented Dec 22, 2015

for example, devices are off, after a restart they are on. so laststate is not saved.

@michbeck100
Copy link
Contributor

I think saving the last state is nice, because it could have changed in the meantime. I think it would be better to ask the led light for it's current state, when starting. Only if this is not possible, saving the state makes sense.

@mwittig
Copy link
Collaborator

mwittig commented Dec 23, 2015

@michbeck100 Generally, you're right. Note, however, some of the LED driver protocols are unidirectional! For Milight, for example, it is not possible to query the state.

@dandresm
Copy link

dandresm commented Feb 8, 2016

It would be nice to have the option to not trigger the switchs on pimatic start. The actual problem is that when pimatic or raspberry restart, all the lights gets switched on.

@michbeck100
Copy link
Contributor

Actually the lights should just be switched on if the saved state says that they have been switched on, when pimatic was stopped. At least that's what this piece of code tries to do:

if @power then @turnOn() else @turnOff()

This code is in the constructor for most devices, but i think this doesn't work, because the default value of @power is "off", and "off" is not a valid value for a boolean, so the expression will always call turnOn().

@mwittig
Copy link
Collaborator

mwittig commented Feb 8, 2016

@michbeck100 You're right. this is a design flaw of the plugin. "true" and "false" shall be used.

@Xento
Copy link
Contributor

Xento commented Feb 22, 2016

Yeah it should be completly switched to true and false.
When this is done the pimatic-hap has to be switched to true and false, too.

@michbeck100
Copy link
Contributor

#66 should fix this

@mwittig mwittig mentioned this issue Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants