jamesleesaunders / PyAlertMe

Python Hive Hub
MIT License
15 stars 3 forks source link

Interested in contributing #48

Closed jrjefferies closed 7 years ago

jrjefferies commented 7 years ago

James,

I have been playing with your code. I have been working on your console-example.py, but I have found some issues with your code pyalertme/node.py - last line self._logger.debug("Attribute Update [Node ID: " + self.id + "\tField: " + attr_name + "\tValue: " + str(attr_value) + "]")

this was a direct print, so it messed up the console.

zbhub.py - in call_device_command, you were sending the device_id, not the device_obj to the two called modules. They expect the device_obj """ this_node_object = self.device_obj_from_id(device_id) if command == 'switch_state': self.send_switch_state_request(this_node_object, value) elif command == 'mode': self.send_mode_request(this_node_object, value)

with these two changes I can get the associated smartplug controlled by the console commands.

I would love to contribute to your code in whatever way I can. Though I am not a professional programmer, I do know some python. My setup is

I would like to get to the point that I can run all the Alertme stuff (primarily smartplugs) from the pi with a rest API (driven be Alexa or Smartthings)...

Regards, James J

andydvsn commented 7 years ago

Sounds like we’re getting ourselves a party going here. Getting the devices to associate with the XBee and drop from ranging mode (double flash) seems like a good first priority. That works reliably with the Hive-SmartPlug-XBee project code, but not with this module.

I’ve not successfully pulled a Button out of ranging mode yet. I do have a spare keyfob... I might give that a whirl soon.

jamesleesaunders commented 7 years ago

Hi James J (and Andy)!

Thank you so much for contributing. Good shouts on these 2 bugs. I have applied your suggested fixes to node.py and zbhub.py hopefully this will work better for you. The console example is one I have forgotten about.

I am so thankful for your offer of contributing, please do make any suggestions you have (I btw would also not consider myself a professional coder, please rest assured that Open Source and GitHub thrives on thrives on people like you who consider themselves 'not professional'! People also say that one of the the best way to learn coding is to contribute to open source :-) so get stuck in!

Please can I ask though that, if you can, please can you submit any code change suggestions you submit them via GitHub pull requests (I can try and talk you through it if needed). If not please do not be put off you can still make suggestions by raising comments and issues (I'll take any help I can get!).

I would also love to hear updates on your project connecting with SmartThings! I am glad my code is coming to some use.

Thanks again for your fixes!

Jim