Since all values coming out of the Thermostat component pass though the
_convert_for_display() method (which handles any necessary rounding),
there is no need to round values that only exist in the internal state
of the thermostat device. It serves no purpose and risks rounding
errors/precision loss.
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.
* Log error for services called without required attributes, in
media_player, notify and thermostat platforms.
* Add fan property and methods in thermostat demo component.
* Add tests for notify file and thermostat demo component.
* Increase coverage of tests for media_player, notify and thermostat
platforms.
* Fix some PEP issues, but not all. Tests still have old linting
errors.
In order for the polymer thermostat component to have sensible step
values the min / max values have to be round numbers. The current code
only does that for systems running in degrees C. For those of us in
silly land that still function in degrees F, this causes some
oddities in the UI.
Always round mix / max values to make it good no matter what
fundamental units we are in.