hass-core/tests/components/sensor
Nicko van Someren 4390fed168 Unpacking RESTful sensor JSON results into attributes. (#10753)
* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* sensor.envirophat: add missing requirement (#7451)

Adding requirements that is not explicitly pulled in by the library
that manages the Enviro pHAT.

* PyPI Openzwave (#7415)

* Remove default zwave config path

PYOZW now has much more comprehensive default handling for the config
path (in src-lib/libopenzwave/libopenzwave.pyx:getConfig()). It looks in
the same place we were looking, plus _many_ more. It will certainly do a
much better job of finding the config files than we will (and will be
updated as the library is changed, so we don't end up chasing it). The
getConfig() method has been there for a while, but was subsntially
improved recently.

This change simply leaves the config_path as None if it is not
specified, which will trigger the default handling in PYOZW.

* Install python-openzwave from PyPI

As of version 0.4, python-openzwave supports installation from PyPI,
which means we can use our 'normal' dependency management tooling to
install it. Yay.

This uses the default 'embed' build (which goes and downloads
statically sources to avoid having to compile anything locally). Check
out the python-openzwave readme for more details.

* Add python-openzwave deps to .travis.yml

Python OpenZwave require the libudev headers to build. This adds the
libudev-dev package to Travis runs via the 'apt' addon for Travis.

Thanks to @MartinHjelmare for this fix.

* Update docker build for PyPI openzwave

Now that PYOZW can be install from PyPI, the docker image build process
can be simplified to remove the explicit compilation of PYOZW.

* Add datadog component (#7158)

* Add datadog component

* Improve test_invalid_config datadog test

* Use assert_setup_component for test setup

* Fix object type for default KNX port

#7429 describes a TypeError that is raised if the port is omitted in the config for the KNX component (integer is required (got type str)). This commit changes the default port from a string to an integer. I expect this will resolve that issue...

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* Added support for extracting JSON attributes from RESTful values

Setting the json_attributes configuration option to true on the
RESTful sensor will cause the result of the REST request to be parsed
as a JSON string and if successful the resulting dictionary will be
used for the attributes of the sensor.

* Added requirement that RESTful JSON results used as attributes must be
objects, not lists.

* Expanded test coverage to test REFTful JSON attributes with and
without a value template.

* Fixed breaks cause by manual upstream merge.

* Added one extra blank line to make PyLint happy.

* Switched json_attributes to be a list of keys rather than a boolean.

The value of json_attributes can now be either a comma sepaated list
of key names or a YAML list of key names. Only matching keys in a
retuned JSON dictionary will be mapped to sensor attributes.

Updated test cases to handle json_attributes being a list.

Also fixed two minor issues arrising from manual merge with 0.58 master.

* Added an explicit default value to the json_attributes config entry.

* Removed self.update() from __init__() body.

* Expended unit tests for error cases of json_attributes processing.

* Align quotes
2017-12-03 16:30:25 +01:00
..
__init__.py Fix PEP257 issues 2016-03-09 10:25:50 +01:00
test_api_streams.py Fix up docstring for tests (#5090) 2016-12-28 20:04:59 +02:00
test_coinmarketcap.py Add display currency setting to CoinMarketCap sensor (#10093) 2017-10-26 18:49:17 +02:00
test_command_line.py Added possibilities to use template in the command_line sensor (#8505) 2017-08-10 18:52:52 +02:00
test_darksky.py aiohttp 2 (#6835) 2017-03-30 00:50:53 -07:00
test_dsmr.py Fix attribute entity (#8066) 2017-06-17 10:03:49 -07:00
test_dte_energy_bridge.py Fix for DTE Energy Bridge returning the wrong units from time to time (#9246) 2017-09-15 23:12:06 -07:00
test_dyson.py Add support to Dyson 360 Eye robot vacuum using new vacuum platform (#8852) 2017-08-06 13:08:46 +02:00
test_efergy.py Change units from KW to W (#8761) 2017-07-31 20:41:45 -07:00
test_fail2ban.py Add fail2ban sensor (#9975) 2017-10-23 09:20:45 +02:00
test_file.py File sensor (#7569) 2017-05-15 14:25:46 +02:00
test_geo_rss_events.py GeoRSS sensor (#9331) 2017-09-24 08:12:38 +02:00
test_google_wifi.py Catch exception (fixes #8724) (#8731) 2017-08-01 19:30:26 +02:00
test_hddtemp.py Add hddtemp sensor device even if unreachable. (#10623) 2017-11-17 09:21:27 -05:00
test_history_stats.py Optimize history_stats efficiency and database usage (#7858) 2017-06-01 22:52:55 -07:00
test_imap_email_content.py Cleanup async handling (#6388) 2017-03-04 15:10:36 -08:00
test_kira.py Add Kira component to sensor and remote platforms (#7479) 2017-05-12 21:12:47 -07:00
test_london_air.py Adds London_air component (#9020) 2017-08-19 11:05:16 +02:00
test_london_underground.py Add london_underground (#8272) 2017-07-02 11:32:38 -07:00
test_mfi.py Fix a bunch of typos (#9545) 2017-09-23 17:15:46 +02:00
test_mhz19.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_min_max.py Feature/min max improvements (#6786) 2017-04-11 13:52:12 +02:00
test_moldindicator.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_moon.py more moon states 2017-03-09 16:54:04 -05:00
test_mqtt.py Adding expire_after to mqtt sensor to expire outdated values (#6708) 2017-03-23 17:55:07 -04:00
test_mqtt_room.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_openhardwaremonitor.py Openhardwaremonitor (#8056) 2017-06-25 13:48:05 -07:00
test_pilight.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_radarr.py Make 'monitored_conditions' optional (#8843) 2017-08-06 10:05:37 +02:00
test_random.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_rest.py Unpacking RESTful sensor JSON results into attributes. (#10753) 2017-12-03 16:30:25 +01:00
test_rflink.py Add option to disable automatic add for lights and sensors. (#6852) 2017-03-30 08:02:03 -07:00
test_rfxtrx.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_ring.py Introducing Ring Door Bell Camera (including StickUp cameras) and WiFi sensors (#9962) 2017-10-21 16:08:40 +02:00
test_season.py Improve unit tests for season sensor component. (#10288) 2017-11-02 11:08:17 +01:00
test_sleepiq.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_sonarr.py Lint Sonarr tests 2017-08-29 08:10:38 -07:00
test_statistics.py Initializing statistics sensor with data from database (#9753) 2017-10-08 23:45:12 +02:00
test_tcp.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_template.py Add entity_picture_template options to Template Cover, Template Light, Template Sensor, and Template Switch (#9854) 2017-10-30 09:28:37 -07:00
test_time_date.py Fix for time_date sensor (#10694) 2017-11-19 19:41:30 -08:00
test_uk_transport.py Add uk_transport component. (#8600) 2017-07-26 20:49:52 +01:00
test_uptime.py fixed typo (#10110) 2017-10-24 14:44:38 +02:00
test_version.py Add version sensor (#8912) 2017-08-12 08:52:56 +02:00
test_vultr.py Fix import in tests (#10525) 2017-11-11 22:24:43 +02:00
test_worldclock.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_wsdot.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_wunderground.py Fix WUnderground error handling, rework entity methods (#10295) 2017-11-25 15:19:52 -05:00
test_yahoo_finance.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_yr.py Add 'forecast' ability to yr weather sensor (#8650) 2017-08-01 22:42:51 -07:00
test_yweather.py Temporarily fix yahoo weather API issue and add unit test. (#10737) 2017-11-23 12:45:56 -08:00
test_zwave.py Repair zwave sensor coverage (#6764) 2017-03-23 20:57:15 -07:00