Two tests were invariably grinding my system to a halt as it was
applying migrations to an empty sqlite database. This patch reduces
the time of a pytest run from 50 to about 16 seconds on my desktop.
The difference is even more noticable on a slower laptop drive, but
is probably insignificant for all you fancy SSD users.
Accept delay configuration even when someone forgets to indent the time
specification.
Also removed 'weeks' and 'microseconds' from acceptable delay values.
There is a new homeassistant release every 2 weeks and running scripts
are not persisting across restarts. And there is still the option of
using (weeks*7) days if the long delay is really necessary.
And if someone really depends on microsecond delay precision we are
unlikely to be able to provide this accuracy, even milliseconds is
suspect for that matter but will at least allow us to specify some
subsecond delay.
vol.IsFile results in an instance of the IsFile method being returned by
the schema validation process. It needs to be called in order to do the
right thing.
The Updater component doesn't make much sense on dev versions. If you
want to run a production config with the updater enabled, you end up
with an 'Update Available' badge pointing you to the last release
version. This change disables the Updater component on dev and updates
the tests to use a faked version number.
A warning is emitted if the Updater component is disabled to ensure
there is no confusion.
This adds an optional 'mac' configuration option to the platform which
is passed to the underlying Orvibo library. The 'mac' option is required
when the switch is connected to a different subnet to the Home Assistant
host
Users of fahrenheit generally expect to see whole degrees. The fahreneit
scale is suffiently precise that decimals aren't really useful in terms
of temperatures humans care about.
This change rounds fahrenheit values to whole degrees and celsius values
to one decimal place. It also renames the ThermostatDevice._convert()
method to _convert_for_display(), making its purpose more clear. It is
not useful for the min_temp() and max_temp() methods, as those relate to
the internal state of the ThermostatDevice object, and may use different
units. Adding optional source and target units to _convert() would have
added needless complexity, it's cleaner to just use convert() in those
methods.
Calculate average download rate the same way as downloadrate
Add config option for choosing which nzbget variables to monitor, and provide a default
Pep8 fixes
Refactoring and changes based on @balloob's comments
Add nzbget.py to .coveragerc omit list. Check if there are any http
errors (like bad auth) when creating the nzbgetapi class. If there
are, the setup_platform() function will return false. Exceptions are
logged as well.
When a new sensor is created, assign the initial value from the api
instead of simply using None until the first update call.