Commit graph

8 commits

Author SHA1 Message Date
Teagan Glenn
122581da7f Proximity unit of measure (#2659)
* Allow multiple proximities

* Distance conversion

* Add unit of measurement and conversion to proximity

* Shorten attribute name

* Fix get unit of measurement

* Fix the km <-> m conversion

* Add type check and errors

* first path unit test around distance utility

* Fix numeric type check

* Fix conversion type-os

* Actually set the exception thrown flag

* Test for exact conversion

* More descriptive variable names

* Update method invocation to match change in method name

* Missed a couple variables

* Line continuation

* Fix linting too many return issue

* Break out proximity setup for list of proximity and for single proximity device

* Pass hass to setup function

* Check if setup succeeded for each proximity component

* Change variable name

* Break out branches in convert to avoid too many branches linting error

* Remove disable lint line

* Variables for default properties

* Combine logic

* Test loading multiple proximities for 100% code coverage on proximity component

* Unit test to reach 100%
Fail to configure proximities missing devices

* Fail first before processing

* Combine return statements

* lstrip = bad Teagan

* Utilize string formating instead of concatenation

* Fix variable reference

* Typeo

* Clean up conversion to reduce complexity

* Update unit tests to match code changes on distance util

* Test non numeric value

* Private methods, value type has already been checked.
2016-07-31 10:20:56 -07:00
Fabian Affolter
b534244e40 Fix PEEP257 issues 2016-03-08 17:55:57 +01:00
Fabian Affolter
b8a40457ee Update docstrings to match PEP257 2016-03-07 18:50:30 +01:00
Paulus Schoutsen
e80309c03c Fix imports (using isort) 2016-02-18 21:27:50 -08:00
Paulus Schoutsen
b29f2f6d6f Remove usage of ATTR_FRIENDLY_NAME within components/platforms 2016-02-14 00:21:20 -08:00
Fabian Affolter
e23db5d972 Some small changes 2016-02-07 12:03:01 +01:00
Fabian Affolter
e311f89056 Move details to docs and update docstrings/comments 2016-02-07 12:00:35 +01:00
Nick Waring
cd0cef6403 Component to track the proximity of devices to a zone 2016-02-07 08:52:32 +00:00