whaleygeek / pyenergenie

A python interface to the Energenie line of products
MIT License
81 stars 51 forks source link

Detecting changes in device state #69

Open whaleygeek opened 8 years ago

whaleygeek commented 8 years ago

Split out from #63

possibly add callbacks such as when_turned_on() when_turned_off() etc.

whaleygeek commented 8 years ago

Also noted in #63 :

(do we need to know what our last sent request is, vs last known reported state? e.g. if we have sent a request but not heard a response yet, this means we think we asked it to turn on, but we don't yet know if it has done that. Some devices can't report back, but some can, so it would be nice to have a four stage state machine for on/off)

(note, would be good to be able to persist the last message received on disk, so that when code restarts, it knows the last send/receive time that was last processed. i.e. a resumable state machine persisted to disk)