Commit Graph

3 Commits

Author SHA1 Message Date
Julian Davis
866c8d6db5
Fix pytest warnings about asyncio (#397)
Turn on ayncio auto mode for pytest and remove the global async marking flag
2022-11-13 23:34:47 +01:00
Teemu R
f9a987ca18
Simplify API documentation by using doctests (#73)
* Add doctests to SmartBulb

* Add SmartDevice doctests, cleanup README.md

* add doctests for smartplug and smartstrip

* add discover doctests

* Fix bulb mock

* add smartdimmer doctests

* add sphinx-generated docs, cleanup readme a bit

* remove sphinx-click as it does not work with asyncclick

* in preparation for rtd hooking, move doc deps to be separate from dev deps

* pytestmark needs to be applied separately for each and every file, this fixes the tests

* use pathlib for resolving relative paths

* Skip discovery doctest on python3.7

The code is just fine, but some reason the mocking behaves differently between 3.7 and 3.8.
The latter seems to accept a discrete object for asyncio.run where the former expects a coroutine..
2020-06-30 02:29:52 +02:00
Connor Proctor
dd073fa8c8
Add transition support for SmartDimmer (#69)
* Adds a transition param to set_brightness(), turn_on(), and turn_off() that specifies the duration in milliseconds that the dimmer switch will take to transition to the new state.
* Fixes bug where set_brightness(0) was allowed even though the dimmer does not support it. Now brightness values of 0 are coerced to 1 to be consistent with bulbs (which do support brightness values of 0).
2020-06-14 18:09:28 +02:00