core/tests/components/sensor
ehendrix23 daf9d28565 Fix mold_indicator errors at startup (#17346)
* Initial changes to resolve issue 16733

Added logic to ensure that if the state is unknown during startup that the error about being unable to parse the value is not logged.
Further,  also ensured that if an attribute is set to None it does not try to convert the None value to Fahrenheit as that will cause an error.

* Cleaned up and added few comments

Cleaned up some lines based on flake8 and pylint.
Added some comment lines on the items added.

* Changed to async and using async_added_to_hass

Changed sensor to use async.
Registering state tracking for sensors and initial setup is now done upon the home assistant start event.

* Updated test and small fix

Updated test to handle unavailable state of sensor and return of None for attributes when data is unavailable.
Ensured that atributes are set to None when state is unavailable due to incorrect data.

* Fixed some flake8 issues in test

Fixed some flake8 issues in test_moldindicator.py.

* Updates based on review

Updates based on review from MartinHjelmare

* Added sensor entity_id to logger errors

Added sensor entity_id to logger error messages
Update test to use constant STATE_UNKNOWN instead of fixed string.
2018-10-17 18:42:39 +02: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_arlo.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_bom.py Fix sensor name (fixes #14535) (#14541) 2018-05-19 17:14:53 +02:00
test_canary.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_coinmarketcap.py Add configurable decimal rounding of display value for CoinMarketCap sensor and upgrade to 5.0.3 (#14437) (#14604) 2018-05-25 15:39:04 +02:00
test_command_line.py Grammar and spelling fixes (#16065) 2018-08-19 22:29:08 +02:00
test_darksky.py Add language parameter to darksky sensor (#13297) 2018-03-22 13:34:02 +01:00
test_deconz.py deCONZ add via_hub attribute for device registry (#16760) 2018-09-21 09:21:44 +02:00
test_dsmr.py Remove usage of "run_until_complete" (#16617) 2018-09-19 15:40:02 +02: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 Refactored units and icons for the Dyson sensors (#14550) 2018-09-21 15:55:07 +02:00
test_efergy.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_fail2ban.py Add fail2ban sensor (#9975) 2017-10-23 09:20:45 +02:00
test_fido.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_file.py Added file path validity checks to file sensor (#12505) 2018-03-29 19:47:49 -07:00
test_filesize.py Adds filesize component (#12211) 2018-02-19 23:55:54 -08:00
test_filter.py Fix rangefilter (#17473) 2018-10-15 12:24:21 +02:00
test_folder.py Adds folder sensor (#12208) 2018-02-21 23:21:07 -08:00
test_foobot.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_geo_rss_events.py emptying device state attributes if the update from the feed fails (#17249) 2018-10-08 16:13:08 +02:00
test_google_wifi.py Grammar and spelling fixes (#16065) 2018-08-19 22:29:08 +02:00
test_hddtemp.py Fix source code using Windows newline (#12248) 2018-02-09 08:11:47 +01:00
test_history_stats.py Fix 0 value when home-assistant restarts (#12874) 2018-03-03 22:59:25 +01:00
test_hydroquebec.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_imap_email_content.py Grammar and spelling fixes (#16065) 2018-08-19 22:29:08 +02:00
test_jewish_calendar.py Bump hdate version to 0.6.5 (#17510) 2018-10-16 13:45:39 +02:00
test_kira.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02: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_melissa.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_mfi.py Grammar and spelling fixes (#16065) 2018-08-19 22:29:08 +02:00
test_mhz19.py Grammar and spelling fixes (#16065) 2018-08-19 22:29:08 +02:00
test_min_max.py Add a 'last' mode and attribute to min_max sensor (#11037) 2018-01-18 23:03:41 +01:00
test_moldindicator.py Fix mold_indicator errors at startup (#17346) 2018-10-17 18:42:39 +02:00
test_moon.py Moon translate (#15498) 2018-07-18 10:54:54 +02:00
test_mqtt.py Implement base for MQTT device registry integration (#16943) 2018-10-08 12:53:30 +02:00
test_mqtt_room.py Grammar and spelling fixes (#16065) 2018-08-19 22:29:08 +02:00
test_nsw_fuel_station.py Add sensor.nsw_fuel_station component (#14757) 2018-06-14 13:56:04 +02: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 add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_random.py Spelling fixes (#12041) 2018-01-29 23:37:19 +01:00
test_rest.py Make rest sensor and binary sensor more efficient (#14484) 2018-09-21 15:54:50 +02:00
test_rflink.py Add availability to Rflink entities. (#14977) 2018-06-16 00:26:48 +02:00
test_rfxtrx.py Grammar and spelling fixes (#16065) 2018-08-19 22:29:08 +02:00
test_ring.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_rmvtransport.py Make rmvtransport async (#17225) 2018-10-10 08:10:42 +02:00
test_season.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_sigfox.py Spelling, grammar etc fixes (#14432) 2018-05-13 12:09:28 +02:00
test_simulated.py add relative time option to simulated sensors (#14038) 2018-06-14 14:06:49 -04:00
test_sleepiq.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_sonarr.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_sql.py Convert decimals from SQL results (#13059) 2018-03-10 10:40:28 -08:00
test_startca.py Add New Sensor for ISP Start.ca (#12356) 2018-02-12 19:43:56 -08:00
test_statistics.py Add rate of change to statistics sensor (#15632) 2018-09-08 01:10:08 +02:00
test_tcp.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_teksavvy.py TekSavvy Sensor unlimited bandwidth support (#12325) 2018-02-28 16:21:10 -08:00
test_template.py still update sensor on startup (#17319) 2018-10-11 11:38:35 +02:00
test_time_date.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_transport_nsw.py Transport NSW (#17242) 2018-10-11 09:44:17 +02:00
test_uk_transport.py Add uk_transport component. (#8600) 2017-07-26 20:49:52 +01:00
test_uptime.py Rename homeassistant.util.async to .async_ (#13088) 2018-03-11 10:01:12 -07:00
test_version.py Add version sensor (#8912) 2017-08-12 08:52:56 +02:00
test_vultr.py add_devices -> add_entities (#16171) 2018-08-24 16:37:30 +02:00
test_worldclock.py Split bootstrap into bs + setup (#6416) 2017-03-05 10:41:54 +01:00
test_wsdot.py Use ATTR_NAME from const.py (#14450) 2018-05-14 13:05:52 +02:00
test_wunderground.py WUnderground unique ids (#13311) 2018-05-02 14:23:07 -04: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 Update pydocstyle to 2.1.1 and flake8-docstrings to 1.3.0 (#14557) 2018-08-24 10:28:43 +02:00
test_zwave.py Repair zwave sensor coverage (#6764) 2017-03-23 20:57:15 -07:00