hass-core/homeassistant/components/sensor
markferry ef22a6e18d Fix statistics sensor mean and median when only one sample is available. (#11180)
* Fix statistics sensor mean and median when only one sample is available.

With only one data point stddev and variance throw an exception.
This would clear the (valid) mean and median calculations.

Separate the try..catch blocks for one-or-more and two-or-more stats so
that this doesn't happen.

Test this with a new sampling_size_1 test.

* test_statistics trivial whitespace fix
2017-12-18 21:21:27 +01:00
..
__init__.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
abode.py Abode Temp, Humidity, and Light Sensor (#9709) 2017-10-07 10:25:53 +02:00
ads.py Add ADS component (#10142) 2017-12-05 09:44:22 +01:00
airvisual.py Fixes AirVisual bug regarding incorrect location data (#10054) 2017-11-17 21:11:05 +01:00
alarmdecoder.py convert alarmdecoder interface from async to sync (#11168) 2017-12-17 00:52:59 +01:00
alpha_vantage.py Add Alpha Vantage sensor (#10873) 2017-12-03 21:34:59 +01:00
amcrest.py Protect sensitive information for Amcrest cameras (#10569) 2017-11-23 16:38:53 -08:00
android_ip_webcam.py move icon battery function from util to helpers (#9708) 2017-10-05 20:55:19 -07:00
apcupsd.py Do not call update() in constructor (#8878) 2017-08-08 20:21:33 +02:00
api_streams.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
arduino.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
arest.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
arlo.py Arlo - Fixes for updated library (#9892) 2017-11-15 23:33:50 +01:00
arwn.py Fix off by one error in arwn platform (#9781) 2017-10-09 15:41:18 +02:00
bbox.py Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
bh1750.py Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
bitcoin.py Upgrade blockchain to 1.4.0 (#9489) 2017-09-19 10:04:11 +02:00
blink.py Blink version bump (#7571) 2017-05-12 20:30:07 -07:00
blockchain.py Sync crypto-currency platforms (#7906) 2017-06-05 13:36:39 +02:00
bloomsky.py Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
bme280.py update i2csense requirement (#8242) 2017-06-29 11:03:52 +02:00
bom.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00
broadlink.py Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
buienradar.py Prevent error when no forecast data was available (#9176) 2017-08-29 15:33:47 +02:00
canary.py Add support for Canary component and platforms (#10306) 2017-12-08 10:40:45 +01:00
cert_expiry.py Fixed cert_expiry sensor to delay firing on HA startup (#8920) 2017-08-12 23:49:15 -07:00
citybikes.py Move constant to 'const.py' and use already defined ones (#10211) 2017-10-29 17:28:07 +01:00
coinmarketcap.py Add display currency setting to CoinMarketCap sensor (#10093) 2017-10-26 18:49:17 +02:00
comed_hourly_pricing.py Increase Comed timeout since it sometimes takes a long time for the API to respond (#9536) 2017-09-25 23:43:02 -07:00
comfoconnect.py Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
command_line.py Added possibilities to use template in the command_line sensor (#8505) 2017-08-10 18:52:52 +02:00
cpuspeed.py Upgrade py-cpuinfo to 3.3.0 (#7992) 2017-06-11 12:03:02 +02:00
crimereports.py Move constant to 'const.py' and use already defined ones (#10211) 2017-10-29 17:28:07 +01:00
cups.py Do not call update() in constructor (#7912) 2017-06-05 17:35:26 +02:00
currencylayer.py Added unit_of_measurement to Currencylayer (#10598) 2017-11-17 08:58:46 +01:00
darksky.py Darksky enhancements (#9851) 2017-10-14 14:45:32 -04:00
deluge.py Add Deluge Sensor (#10117) 2017-10-25 15:13:11 +02:00
demo.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
deutsche_bahn.py Upgrade schiene to 0.19 (#10887) 2017-12-01 12:26:15 +01:00
dht.py Fix dht22 when no data was read initially #8976 (#9198) 2017-08-28 22:46:31 +03:00
discogs.py Add Discogs Sensor platform (#10957) 2017-12-18 19:10:54 +01:00
dnsip.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
dovado.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
dsmr.py Implement DSMR5 support. (#9686) 2017-10-04 10:20:08 +02:00
dte_energy_bridge.py Added support for the DTE Energy Bridge v2 (#9431) 2017-09-18 17:33:58 +02:00
dublin_bus_transport.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
dwd_weather_warnings.py Added DWD WarnApp Sensor (#8657) 2017-09-05 08:40:47 -07:00
dweet.py Do not call update() in constructor (#7917) 2017-06-05 21:28:13 +02:00
dyson.py Add support to Dyson 360 Eye robot vacuum using new vacuum platform (#8852) 2017-08-06 13:08:46 +02:00
ebox.py Do not call update() in constructor (#7917) 2017-06-05 21:28:13 +02:00
ecobee.py Do not call update() in constructor (#7917) 2017-06-05 21:28:13 +02:00
eddystone_temperature.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00
efergy.py set default utc offset to 0 (#11114) 2017-12-13 20:03:41 -08:00
eight_sleep.py Catch divide by zero errors when a sleep type is 0 (#8809) 2017-08-03 15:58:40 +02:00
eliqonline.py Update eliqonline.py (#10914) 2017-12-03 16:48:07 +01:00
emoncms.py Use feed name assigned in EmonCMS if there is one (#10021) 2017-10-22 12:12:36 +02:00
enocean.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
envirophat.py Fix a bunch of typos (#9545) 2017-09-23 17:15:46 +02:00
envisalink.py Cleanup and simplitfy the async state update (#9390) 2017-09-12 10:01:03 +02:00
etherscan.py Sync crypto-currency platforms (#7906) 2017-06-05 13:36:39 +02:00
fail2ban.py Add fail2ban sensor (#9975) 2017-10-23 09:20:45 +02:00
fastdotcom.py Upgrade fastdotcom to 0.0.3 (#10886) 2017-12-01 12:25:54 +01:00
fedex.py FedEx: Adds "packages" as a unit (#9588) 2017-09-27 10:44:41 -07:00
fido.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
file.py File sensor (#7569) 2017-05-15 14:25:46 +02:00
fitbit.py Refactored to new global json saving and loading (#10677) 2017-11-19 19:47:55 -08:00
fixer.py Do not call update() in constructor (#7912) 2017-06-05 17:35:26 +02:00
fritzbox_callmonitor.py Update fritzconnection to 0.6.5 (#9950) 2017-10-18 20:58:26 +02:00
fritzbox_netmonitor.py Add transmission rate (#10740) 2017-11-22 08:39:45 +01:00
gearbest.py Gearbest sensor (#10556) 2017-12-05 12:32:43 +01:00
geizhals.py Fix Geizhals index issue when not 4 prices available (#9035) 2017-08-18 19:59:20 +02:00
geo_rss_events.py Move constant to 'const.py' and use already defined ones (#10211) 2017-10-29 17:28:07 +01:00
gitter.py Move constant to 'const.py' and use already defined ones (#10211) 2017-10-29 17:28:07 +01:00
glances.py Remove STATE_UNKNOWN (#10064) 2017-10-23 13:12:14 +02:00
google_travel_time.py Move constant to 'const.py' and use already definied ones (#10204) 2017-10-29 12:32:02 +01:00
google_wifi.py Added rounding to Google Wifi (#8866) 2017-08-06 18:29:52 +03:00
gpsd.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00
gtfs.py GTFS: check start/end date on services (#8373) 2017-07-06 22:22:31 -07:00
haveibeenpwned.py Use constants for HTTP headers (#10313) 2017-11-04 12:04:05 -07:00
hddtemp.py Add hddtemp sensor device even if unreachable. (#10623) 2017-11-17 09:21:27 -05:00
history_stats.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00
hive.py New Hive Component / Platforms (#9804) 2017-11-23 13:10:23 +01:00
homematic.py Upgrade HomeMatic, add devices (#10845) 2017-11-28 23:16:47 -08:00
hp_ilo.py Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
htu21d.py update i2csense requirement (#8242) 2017-06-29 11:03:52 +02:00
hydroquebec.py Hydroquebec component use now asyncio (#10795) 2017-12-17 22:11:48 +01:00
imap.py Allow folder selection for IMAP unread sensor (#10126) 2017-10-25 11:36:00 +02:00
imap_email_content.py Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
influxdb.py Upgrade influxdb to 4.1.1 (#9652) 2017-10-02 17:17:08 +02:00
ios.py move icon battery function from util to helpers (#9708) 2017-10-05 20:55:19 -07:00
irish_rail_transport.py add irish rail transport sensor (#9883) 2017-10-22 14:18:34 +02:00
isy994.py ISY994 sensor improvements (#10805) 2017-12-13 20:14:56 -08:00
juicenet.py Add juicenet platform (#7668) 2017-06-05 08:39:31 -07:00
kira.py Add Kira component to sensor and remote platforms (#7479) 2017-05-12 21:12:47 -07:00
knx.py renamed add_devices to async_add_devices according to hass naming scheme (second try after failed #9485) (#9505) 2017-09-20 01:15:20 -04:00
kwb.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00
lacrosse.py Add LaCrosse sensor platform (#10195) 2017-11-03 08:59:11 +01:00
lastfm.py Upgrade pylast to 2.0.0 (#10200) 2017-10-29 11:54:11 +01:00
linux_battery.py Do not call update() in constructor (#7912) 2017-06-05 17:35:26 +02:00
london_air.py Fixes issue #10425 (#10426) 2017-11-07 18:19:54 +01:00
london_underground.py Fix doc link in header (#8305) 2017-07-03 08:30:42 +02:00
loopenergy.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
luftdaten.py Use luftdaten module (#10970) 2017-12-12 08:09:47 +01:00
lyft.py Upgrade lyft_rides to 0.2 (#9578) 2017-09-25 22:34:48 +02:00
metoffice.py Remove km from visibility, add visibility_distance (#8454) 2017-07-13 20:01:25 -07:00
mfi.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
mhz19.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
miflora.py Added force_update for REST sensor (#11016) 2017-12-09 08:18:45 +01:00
min_max.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
modbus.py Fix ValueError exception (#10596) 2017-11-15 18:17:17 -05:00
modem_callerid.py Switch basicmodem and python-roku to pypi (#7514) 2017-05-09 20:23:19 -07:00
mold_indicator.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
moon.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00
mopar.py fix mopar sensor (#9389) 2017-09-12 19:50:28 -07:00
mqtt.py Added force_update for REST sensor (#11016) 2017-12-09 08:18:45 +01:00
mqtt_room.py Move constant to 'const.py' and use already defined ones (#10211) 2017-10-29 17:28:07 +01:00
mvglive.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00
mysensors.py Refactor mysensors callback and add validation (#9069) 2017-08-25 08:58:05 -07:00
nederlandse_spoorwegen.py Update nederlandse_spoorwegen.py to include platform information (#10494) 2017-11-11 11:51:26 -08:00
nest.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
netatmo.py Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
netdata.py More netdata sensors (#9719) 2017-10-07 00:22:40 +02:00
neurio_energy.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
nut.py Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
nzbget.py Use constants for HTTP headers (#10313) 2017-11-04 12:04:05 -07:00
octoprint.py Remove logging (#11173) 2017-12-16 22:29:40 +01:00
ohmconnect.py Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
onewire.py Refactoring of onewire sensor component (#9691) 2017-10-04 16:35:58 +02:00
openevse.py Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
openexchangerates.py Do not call update() in constructor (#8859) 2017-08-06 10:21:55 -07:00
openhardwaremonitor.py Fix some issues for PyLint 1.7.2 (#8356) 2017-07-05 20:02:16 -07:00
opensky.py Move constant to 'const.py' and use already defined ones (#10211) 2017-10-29 17:28:07 +01:00
openweathermap.py handle OWM API error calls (#9865) 2017-10-15 10:31:34 +02:00
otp.py Cleanup and simplitfy the async state update (#9390) 2017-09-12 10:01:03 +02:00
pi_hole.py Changed Pi-hole graphs from stacked bar to line (#8896) 2017-08-08 22:57:35 +02:00
pilight.py Cleanup async handling (#6388) 2017-03-04 15:10:36 -08:00
plex.py Plex refactor Part 1 - Update plexapi to 3.0.3 (#9988) 2017-10-25 11:42:13 +02:00
pocketcasts.py Do not call update() in constructor (#8847) 2017-08-06 10:07:45 +02:00
pushbullet.py Upgrade pushbullet.py to 0.11.0 (#8691) 2017-07-28 23:22:35 -07:00
pvoutput.py Move 'voltage' to const (#9621) 2017-09-29 12:05:02 +02:00
pyload.py Use constants for HTTP headers (#10313) 2017-11-04 12:04:05 -07:00
qnap.py Persistent notification import (#8507) 2017-07-16 21:39:38 +02:00
radarr.py Fix Sonarr and Radarr divide by zero (#10101) 2017-10-25 11:37:08 +02:00
raincloud.py Bump raincloudy version 0.0.3 (#9767) 2017-10-08 21:08:40 -07:00
random.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
rest.py Added force_update for REST sensor (#11016) 2017-12-09 08:18:45 +01:00
rflink.py Correct spelling of aliases, deprecate old config options. (#8348) 2017-07-06 15:59:54 +02:00
rfxtrx.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
ring.py Fixed update() method and removed ding feature from stickupcams/floodlight (#10428) 2017-11-09 01:01:20 +01:00
ripple.py update pyripple (#11122) 2017-12-13 21:21:14 +01:00
sabnzbd.py Adding Queue count sensor (#10723) 2017-11-21 15:35:23 +01:00
scrape.py Add support for HTTP Basic/Digest authentication 2017-10-23 17:48:51 +02:00
season.py Support for season sensor (#8958) 2017-08-29 16:18:36 +02:00
sensehat.py Do not call update() in constructor (#8878) 2017-08-08 20:21:33 +02:00
serial.py Add debug (#10828) 2017-11-27 21:25:00 +01:00
serial_pm.py Add temperature support for MH-Z19 CO2 sensor. (#6169) 2017-02-27 21:19:11 +02:00
shodan.py Upgrade shodan to 1.7.7 (#11084) 2017-12-11 16:44:14 +01:00
skybeacon.py Block dependencies that depend on enum34 (#8698) 2017-08-04 23:06:10 -07:00
skybell.py Skybell (#9681) 2017-10-08 20:14:39 +02:00
sleepiq.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
sma.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
snmp.py Upgrade pysnmp to 4.4.2 (#10539) 2017-11-13 09:24:07 -08:00
sonarr.py Fix Sonarr and Radarr divide by zero (#10101) 2017-10-25 11:37:08 +02:00
speedtest.py Upgrade speedtest-cli to 1.0.7 (#9984) 2017-10-20 20:28:11 +02:00
statistics.py Fix statistics sensor mean and median when only one sample is available. (#11180) 2017-12-18 21:21:27 +01:00
steam_online.py Changed returned attribute from "Game" to "game" (#9945) 2017-10-18 18:27:02 +02:00
supervisord.py Catch ConnectionRefusedError (#8844) 2017-08-06 10:08:00 +02:00
swiss_hydrological_data.py Do not call update() in constructor (#8878) 2017-08-08 20:21:33 +02:00
swiss_public_transport.py Upgrade python_opendata_transport to 0.0.3 (#10162) 2017-10-27 08:01:12 +02:00
synologydsm.py Move constant to 'const.py' (#10249) 2017-10-31 13:31:12 +01:00
systemmonitor.py Upgrade psutil to 5.4.2 (#11083) 2017-12-11 13:52:43 +01:00
sytadin.py Sytadin default value must be a list #10233 (#10234) 2017-10-31 08:32:26 +01:00
tado.py Move constant to 'const.py' and use already defined ones (#10211) 2017-10-29 17:28:07 +01:00
tahoma.py Tahoma platform for Somfy Covers and Sensors (#10652) 2017-11-19 21:35:13 +01:00
tank_utility.py Add Tank Utility sensor (#9132) 2017-08-30 22:21:54 +02:00
tcp.py Fix TCP sensor to correctly use value_template (#5211) 2017-01-11 17:26:29 +01:00
ted5000.py Update docstrings (#7374) 2017-05-02 09:18:47 -07:00
tellduslive.py Added sensor types from telldus server src (#10787) 2017-11-27 10:11:00 +01:00
tellstick.py tellstick fix DEPENDENCIES and update tellcore-net (#10859) 2017-11-30 21:13:18 +01:00
temper.py Upgrade temperusb to 1.5.3 (#7428) 2017-05-04 07:46:43 +02:00
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
tesla.py Set percent unit for battery level so that history displays properly; edited variable name for consistency (#10932) 2017-12-04 08:34:42 +01:00
thethingsnetwork.py Use constants for HTTP headers (#10313) 2017-11-04 12:04:05 -07:00
thinkingcleaner.py Clean up requirements (#7391) 2017-05-02 09:15:02 -07:00
tibber.py update tibber library (#10460) 2017-11-08 11:18:35 +01:00
time_date.py Fix for time_date sensor (#10694) 2017-11-19 19:41:30 -08:00
toon.py Fix PEP8 and PEP257 issues (#10108) 2017-10-24 18:36:08 +02:00
torque.py Cleanup and simplitfy the async state update (#9390) 2017-09-12 10:01:03 +02:00
tradfri.py Update pytradfri to 4.1.0 (#10521) 2017-11-22 09:37:20 +00:00
transmission.py Add transmission sensor: number of active torrents (#9914) 2017-10-17 22:45:37 +02:00
travisci.py Introducing support to Travis-CI (#9701) 2017-10-07 11:02:40 +02:00
twitch.py Do not call update() in constructor (#7912) 2017-06-05 17:35:26 +02:00
uber.py Upgrade uber_rides to 0.6.0 (#9457) 2017-09-17 13:40:58 +02:00
uk_transport.py Move constant to 'const.py' and use already definied ones (#10204) 2017-10-29 12:32:02 +01:00
upnp.py Upnp properties (#8067) 2017-06-18 21:32:39 -07:00
ups.py Fixes UPS MyChoice exception (#9587) 2017-09-27 10:44:32 -07:00
uptime.py Added minutes to uptime sensor 2017-10-23 14:38:16 -04:00
usps.py fix usps? (#9557) 2017-09-24 08:28:11 +02:00
vasttrafik.py Do not call update() in constructor (#8840) 2017-08-06 10:03:57 +02:00
vera.py Added Vera scenes (#10424) 2017-12-07 07:47:19 +01:00
verisure.py WIP: Verisure app api (#7394) 2017-06-26 22:30:25 +02:00
version.py Add version sensor (#8912) 2017-08-12 08:52:56 +02:00
viaggiatreno.py New sensor viaggiatreno. (#10522) 2017-11-15 22:07:16 -08:00
volvooncall.py Volvo on call: Optional use of Scandinavian miles. Also add average fuel consumption property (#11051) 2017-12-10 13:57:44 -08:00
vultr.py Add platform and sensors for Vultr VPS (#9928) 2017-11-05 14:10:14 +01:00
waqi.py Update waqi sensor (#8385) 2017-07-07 07:55:58 -07:00
whois.py Refactored WHOIS sensor to resolve assumed key errors (#10662) 2017-12-01 11:36:15 -05:00
wink.py Additional Wink lock features (#7445) 2017-05-13 14:09:00 -04:00
worldclock.py Do not call update() in constructor (#7912) 2017-06-05 17:35:26 +02:00
worldtidesinfo.py fix worldtidesinfo #9184 (#9201) 2017-08-29 08:28:40 +02:00
worxlandroid.py renamed add_devices to async_add_devices according to hass naming scheme (second try after failed #9485) (#9505) 2017-09-20 01:15:20 -04:00
wsdot.py Update docstring (quotes, links, content) (#5602) 2017-01-28 16:02:19 +01:00
wunderground.py Fix WUnderground error handling, rework entity methods (#10295) 2017-11-25 15:19:52 -05:00
xbox_live.py Don't use len(SEQUENCE) as condition value (#7249) 2017-04-23 20:41:09 -07:00
xiaomi_aqara.py fix gateway illumination sensor value (#10045) 2017-10-23 08:02:20 +02:00
yahoo_finance.py Do not call update() in constructor (#7917) 2017-06-05 21:28:13 +02:00
yr.py Improvements (configuration and validation) (#8785) 2017-08-02 14:51:09 +02:00
yweather.py Temporarily fix yahoo weather API issue and add unit test. (#10737) 2017-11-23 12:45:56 -08:00
zabbix.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
zamg.py Use constants for HTTP headers (#10313) 2017-11-04 12:04:05 -07:00
zha.py zha: Update to bellows 0.4.0 (#9890) 2017-10-15 21:41:16 -07:00
zigbee.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
zoneminder.py Update docstrings (#7405) 2017-05-02 22:47:20 +02:00
zwave.py Fix pylint 1.7.2 no-else-return issues (#8361) 2017-07-05 23:30:01 -07:00