Commit Graph

15 Commits

Author SHA1 Message Date
Teemu R
345216e245
Add reboot command to restart the device (#129) 2018-09-08 16:11:58 +02:00
kwazel
ce89c0d800 Allow using alias instead of IP address or hostname (#127)
* Added option to control devices by device name

* set unused ip address to dont-care

* spend less time discovering by devicename, removed command

* consistent use of alias instead of device name

* processed review comments

* Return when no device with alias has been found
2018-08-30 23:22:23 +03:00
Teemu R
ab103c3a1a
add 'alias' command for querying and setting the alias (#126)
* add 'alias' command for querying and setting the alias

* calculate coverage only on library files, e.g., ignoring cli and test files

* remove py34 and add py37

* readd py33, remove it from travis as it seems to be a travis limitation only

* use xenial dist for travis, regular does not support py37..
2018-08-13 20:37:43 +02:00
Thibault Cohen
c6739daacc Add bulb valid temperature range (#122) 2018-06-17 19:01:18 +02:00
K Henriksson
d40fff4f9e Add support for DNS host names (#104) 2018-01-17 22:03:19 +01:00
K Henriksson
a426488449 Use direct device type discovery for devices (#106)
This is more efficient than enumerating all devices and checking the IP.
2018-01-14 19:10:53 +01:00
Teemu Rytilahti
34347e59ae cli: add 'time' command to get the current time from the device 2017-10-17 00:53:18 +02:00
Sean Gollschewsky
25e550d3fe Fix brightness and temperature. (#89) 2017-09-15 14:23:06 +02:00
Teemu Rytilahti
1d7e5fa73c remove unused tplinksmarthomeprotocol import 2017-08-05 17:30:40 +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
Teemu R
10544004cc add @pass_dev to hsv, adjust ranges (#70)
* add @pass_dev to hsv command, it was always broken

* Hue goes up to 360, saturation and value are up to 100(%)
2017-08-03 22:13:56 +02:00
Teemu R
09e8948790 generalize smartdevice class and add bulb support for the cli tool (#50)
Fixes #48 and #51. The basic functionality should work on all types of supported devices, for bulb specific commands it is currently necessary to specify ```--bulb```.
2017-04-24 19:28:22 +02:00
Teemu R
86f14642c8 Refactor and drop py2 support (#49)
* move is_off property to SmartDevice, implement is_on for bulb and use it

* refactor by moving smartbulb and smartplug to their own classes

* drop python2 compatibility, make flake8 happy

* travis: remove 2.7, add 3.6
2017-04-14 14:24:58 +02:00
Teemu Rytilahti
23e51a8686 cli: display an error if no ip is given
also bump the version to 0.2.4.1 with this fix.
2017-03-26 03:22:18 +02:00
Teemu R
d253b55d41 Add new client tool (#42)
* Add new client tool

After installing the package pyhs100 command-line tool can be used
to control the plug.

See --help for its usage, most of the features for plugs are implemented,
some of the shared functionality works for bulbs too.

* Add discover command

* Delete old examples, the cli works as an example well enough
2017-03-20 19:03:19 +01:00