I’ve managed to merge my sample state machine code into homegenie and have occupancy crudely working…
Just need to add a way of adding a module to a location… question is - does the location class hold a module list or should the module have a location field?
Hmm…
I want to trigger things when a module changes - I guess having it on the module saves enumerating the list each time? @Bounz?
however you tell it to be, at the moment I have an enum containing statically defined triggers and use the module Helper to trigger it, but I feel we can do better yet, need to wrap my head around the Helper classes yet.
for reference - i was modeling this around what I want to achieve - needs more tweaking yet I think so that I can test it properly but I can export the statemachine in dot format which lets you display what I am thinking:
I think I have got to the bottom of serialising the classes now - unfortunatley not as XML (binary) - I’m then going to see if I can make state persist reboots and software upgrades… Maybe…