Code Monkey home page Code Monkey logo

insteonlocal's Issues

Empty string from status

I've got the Home Assistant working to toggle locally, however, in order to get status, I have to comment out line 308 of Hub.py otherwise I get an empty string for raw_text and a nonetype returned. Was this just needed to trim the trailing zeros?

(raw_text value starts with a zero when I'm stepping through)

Typo causing logging to fail.

https://github.com/phareous/insteonlocal/blob/master/insteonlocal/Dimmer.py#L106

Please replace the %S with %s

Jun 05 18:54:53 mozart docker[1232]: ValueError: unsupported format character 'S' (0x53) at index 8
Jun 05 18:54:53 mozart docker[1232]: Call stack:
Jun 05 18:54:53 mozart docker[1232]:   File "/usr/local/lib/python3.6/threading.py", line 884, in _bootstrap
Jun 05 18:54:53 mozart docker[1232]:     self._bootstrap_inner()
Jun 05 18:54:53 mozart docker[1232]:   File "/usr/local/lib/python3.6/threading.py", line 916, in _bootstrap_inner
Jun 05 18:54:53 mozart docker[1232]:     self.run()
Jun 05 18:54:53 mozart docker[1232]:   File "/usr/local/lib/python3.6/threading.py", line 864, in run
Jun 05 18:54:53 mozart docker[1232]:     self._target(*self._args, **self._kwargs)
Jun 05 18:54:53 mozart docker[1232]:   File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 66, in _worker
Jun 05 18:54:53 mozart docker[1232]:     work_item.run()
Jun 05 18:54:53 mozart docker[1232]:   File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 55, in run
Jun 05 18:54:53 mozart docker[1232]:     result = self.fn(*self.args, **self.kwargs)
Jun 05 18:54:53 mozart docker[1232]:   File "/usr/src/app/homeassistant/components/light/insteon_local.py", line 178, in turn_on
Jun 05 18:54:53 mozart docker[1232]:     self.node.change_level(brightness)
Jun 05 18:54:53 mozart docker[1232]:   File "/usr/local/lib/python3.6/site-packages/insteonlocal/Dimmer.py", line 107, in change_level
Jun 05 18:54:53 mozart docker[1232]:     level)
Jun 05 18:54:53 mozart docker[1232]: Message: 'Dimmer %S change_level: level %s'

Security issue in insteonlocal latest versions - Possible Supply Chain Attack

Impact of the bug
Malicious code execution

Describe the bug
There are an unmet dependency in setup.py and requirements.txt - library pprint:

https://github.com/phareous/insteonlocal/blob/master/setup.py#L14

https://github.com/phareous/insteonlocal/blob/master/requirements.txt#L3

Despite pprint library is built-in, it can be reinstalled using pypi if:

  • someone will register it
  • version of this library will be more than built-in, e.g. 112.0

For now, this package does not registered:

python -m pip install pprint
ERROR: Could not find a version that satisfies the requirement pprint (from versions: none)
ERROR: No matching distribution found for pprint

Affected versions:
At least insteonlocal 0.53 and 0.52 are affected (the latest one).

Solution:
Need to delete these potential unsafe packages from pypi and probably publish new version without these verbose dependencies.

Add HTTP status code check

INFO:insteonlocal.Hub:getBufferStatus: Got raw text with size 35 and contents: 401 Unauthorized: Password required INFO:insteonlocal.Hub:postDirectCommand: http://192.168.1.2:25105/1?XB=M=1 INFO:insteonlocal.Hub:clearBuffer: <Response [401]> OrderedDict([('error', False), ('success', True), ('message', ''), ('msgs', [OrderedDict([('im_code', '1 ')]), OrderedDict([('im_code', 'au')]), OrderedDict([('im_code', 'or')]), OrderedDict([('im_code', 'ed')]), OrderedDict([('im_code', 'Pa')]), OrderedDict([('im_code', 'wo')]), OrderedDict([('im_code', ' r')]), OrderedDict([('im_code', 'ui')])])])
INFO:insteonlocal.Hub: Dimmer 2F25FD status: None

MaxListnersExceededWarning

I am getting the following error in my log. I had no issues until today and no config change was made, the devices just stopped reporting status and not responding to state changes.

(node:3248) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 connect listeners added to [Insteon]. Use emitter.setMaxListeners() to increase limit
(Use node --trace-warnings ... to show where the warning was created)

Dimmers flicker

Few weeks in to Home Assistant.. Loaded the insteon lights and switches. I have 16 lights/dimmers 7switches several firmware versions and types.
Hub 2245-222.

It seems the polling/checking states causes a lot of traffic. I have noticed when homeassistant is running several of my dimmers flicker randomly.So we'll see the lights turn off and on <1 second. When I turn off homeassistant/insteon config they no longer flicker. Is there a way to slow down how often it checks states?

Vanilla install..
Has anyone ran into this?

Thanks!

Max Listeners

I am getting the following error in my log. I had no issues until today and no config change was made, the devices just stopped reporting status and not responding to state changes.

(node:3248) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 connect listeners added to [Insteon]. Use emitter.setMaxListeners() to increase limit
(Use node --trace-warnings ... to show where the warning was created)

No links in pypi

Hey,
re: home-assistant/core#3811
I'm getting started on trying to integrate this with HomeAssistant and https://pypi.python.org/simple/insteonlocal/ seems to be empty resulting in an error when trying to pip install or include in requirements.txt.

I was able to install it by pip install git+https://github.com/phareous/insteonlocal.git but unfortunately the requirements parser seems to barf on that, so I can't really include it properly.

In the issue on the hass project you had mentioned are a PHP developer by trade. I work as a PHP dev too and this is the first real python project I'm trying to dig my teeth into, so unfortunately I don't have any experience with pip and can't offer any quick fixes.

Cache not being used

This library becomes extremely slow and unreliable once I add > 10 devices. I tried to debug and found that cache is not being used.

I added a debug line around line 447/448 in Hub.py and found this:

get_device_status for device 43****
INFO:homeassistant.components.insteon_local:key 1900 not in command cache
INFO:homeassistant.components.insteon_local:no cached status for device 43****

I tried to rebuild the cache at this point, but that did not solve the issue.Any idea what would cause this?

I am using HA in virtualenv.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.