From: Bruce W. <br...@mi...> - 2000-05-11 03:36:04
|
> I started a new post as this is unrelated to the weather questions I had. > What is the recommended/preferred way of creating a new device/hardware > 'type' in the system. I want to create a class to interface MH with my > Compool pool equipment (Compool has a RS485 interface, I have there > RS485/232 adapter on order, and the protocol specification from > them). The > protocol lets me do things like set spa and pool temp and turn on/off > auxiliary equipment relays. > > I suspect I want to build ontop of the serial class, like the X10 > code does, > but from looking thru the various sources it's a bit unclear to > me where the best starting point actually is. Yep, extendin Serial_Item with an Compool.pm (or whatever) module, like X10_Item.pm does, should work well. You then would inherit the state, state_now, said, and set methods. If other methods make sense, just add them to your new module. Or you can just use Serial_Item directly, if you don't need extra methods. For an example, see mh/code/bruce/irman.pl If in doing this, it would help to have some sort of change to mh, or if you need a more specific example, let me know. I just might have to install a pool to test out your code :) Bruce |