dynasticorpheus / gigasetelements-cli

Gigaset Elements - python based command line interface
GNU General Public License v2.0
35 stars 11 forks source link

Swiss Smart-Plug causes gigasetelements-cli to crash #31

Closed dan-m-joha closed 4 years ago

dan-m-joha commented 4 years ago

I am based in Switzerland and I am trying gigasetelements-cli. I have a "Swiss Smart-Plug" in my setup. When a for instance call "gigasetelements-cli -ss" it crashes with the following:

File "/usr/local/lib/python3.7/dist-packages/gigasetelements/gigasetelements.py", line 276, in collect_hw
sensor_exist.update(dict.fromkeys([SENSOR_FRIENDLY[item]], True))
KeyError: 'sp02'

Adding "'sp02': 'smart_plug'" to SENSOR_FRIENDLY at least makes the "gigasetelements-cli -ss" work. I can see in the code that there are other references to "sp01", but as I am not a Python programmer I am not sure how to fix that.

Regards, -- Dan

dynasticorpheus commented 4 years ago

@dan-m-joha Thanks for reporting will fix soon

dynasticorpheus commented 4 years ago

@dan-m-joha ps: Quick fix would be a simple find/replace of all sp01 into sp02

dynasticorpheus commented 4 years ago

@dan-m-joha Can you test if all works ok now using latest dev version?

dan-m-joha commented 4 years ago

@dan-m-joha ps: Quick fix would be a simple find/replace of all sp01 into sp02 That is exactly what I did ;-)

I have now installed the new version and it works great. THANKS!!!

I have one question though: If a have more than one Plug - how do I select which plug to control with the -g argument?

Regards, -- Dan