Commit Graph

4 Commits

Author SHA1 Message Date
Sean Gollschewsky
a621f5329d Prevent failure if device's sysinfo does not have a "feature" attribute. (#77) 2017-08-06 15:42:33 +02:00
Teemu Rytilahti
92c9cddfd4 return None instead of False for emeter related actions 2017-08-05 17:30:40 +02:00
Teemu R
0927930f41 wrap sysinfo to defaultdict to return None for keys which do not exist, makes unsupported keys not to fail hard (#72) 2017-08-05 17:28:45 +02:00
Teemu R
07af48e41a Discover refactoring, enhancements to the cli tool (#71)
* Discover refactoring, enhancements to the cli tool

* Discover tries to detect the type of the device from sysinfo response
* Discover.discover() returns an IP address keyed dictionary,
  values are initialized instances of the automatically detected device type.

* When no IP is given, autodetect all supported devices and print out their states
* When only IP but no type is given, autodetect type and make a call based on that information.
  * One can define --bulb or --plug to skip the detection.

* renamed pyHS100.py -> smartdevice.py

* SmartPlugException -> SmartDeviceException in comments

* fix mic_type check

* make time() return None on failure as we don't know which devices support getting the time and it's used in the cli tool

* hw_info: check if key exists before accessing it, add mic_mac and mic_type

* Check for mic_mac on mac, based on work by kdschloesser on issue #59

* make hound happy, __init__ on SmartDevice cannot error out so removing 'raises' documentation
2017-08-05 15:49:56 +02:00