nugget / python-insteonplm

Python 3 asyncio module for interfacing with Insteon Powerline modems
MIT License
33 stars 19 forks source link

Adding Sample #123

Closed lanrongwen closed 4 years ago

lanrongwen commented 5 years ago

Adding some sample code to help people understand how to use the code outside of Home Assistant.

lanrongwen commented 5 years ago

Found a few small issues, will be doing some quick updates then I'll repost.

teharris1 commented 5 years ago

Good idea. This was always intended to be broader than just HA so glad you are doing this.

lanrongwen commented 5 years ago

I think I still have a few more small tweaks but I'm getting closer.

lanrongwen commented 5 years ago

I feel I'm close, but I'm having a few issues in my testing that I could use some feedback on:

  1. Sometimes it fails to find/refresh devices
  2. I have a weird issue where when comparing the temp to the desired temp it comes back incorrectly and will cause it to go to the wrong state, see the following log sample with a few minor edits to clarify:
    INFO:__main__:Reporting on Zone/Thermo: thehouse/downstairs
    INFO:__main__:      Temp is: 75.7
    INFO:__main__:      Humidity is: 39
    INFO:__main__:      Mode is: ThermostatMode.COOL
    INFO:__main__:      Fan is: ThermostatMode.FAN_AUTO
    INFO:__main__:Now setting desired state for Thermo thehouse/downstairs (is main: True)
    INFO:__main__:      Probably done with cooling ( current temp 75.7 / threshold temp 68)
    INFO:__main__:Will set to ThermostatMode.OFF with a set point of: 0

    The idea was as long as the temp is above the threshold, it should keep cooling, but it doesn't. :/ See line 173 in the code.

lanrongwen commented 5 years ago

Figured it out, I was just staring at it too long on the temp checks. It feels more consistent on the polling, but I haven't really touched that yet, so we'll see. I think this is good for initial review/feedback.

teharris1 commented 5 years ago

I will look at this tonight and try in my test environment. In the meantime you have some pylint issues (mostly line too long). Can you have a look at that? Thanks

lanrongwen commented 5 years ago

Sorry about the lint test, thought I had caught them all. :)

teharris1 commented 4 years ago

@lanrongwen let me know if you want to reopen this. Given that it is a year old and not passing the tests. I am going to close this as stale.