Some Sonos devices (e.g SUB) does not have
a upnp media renderer, but are discovered as sonos
devices. Creating a SonosDevice object from such a
device will fail.
When a sonos player goes offline an endless stream of
exceptions is raised. That happens because homeassistant keeps trying
to refresh its status.
This can happen even when a sonos player has gone offline **before**
homeassistant is started. The sonos players take some time before
realizing one of their mates is no longer online, leading to the same
stream of exceptions inside of homeassistant.
Three types of exceptions of can be raised:
- `requests.packages.urllib3.exceptions.MaxRetryError`
- `requests.packages.urllib3.exceptions.NewConnectionError`
- `TimeoutError`
It's not possible to handle all of them with a single `except` block
because they are raised in a random order and after some delays. That
means a 2nd or 3rd exception can take place while handling the 1st one.
The only solution is to check whether a a player is actually reachable
by attempting to connect to a service that must be running on it.
Also all the players in a 'unknown' state should not be polled by
homeassistant (despite of their brand).
I'm going to upstream the `_is_reachable` method I added to the
`sonos.py` file into `SoCo`. In the meantime we must ship this piece
of code with homeassistant.
Signed-off-by: Flavio Castelli <fcastelli@suse.com>
* SCSGATE: Actually cycle through all devices to register
Modify _activate_next_device function to actually cycle through self-devices_to_register instead of simply checking whether there are any and onl registering one
* Deleted extra white lines
* Add STATE_UNAVAILABLE to states that are ignored when writing to the
database. This will avoid a field type error for string if the field
already contains a different type, eg integer.
* Add test for ignored states for influxdb.
* Clean up influxdb tests.
CONF_PURGE_DAYS so it can be changed easier later.
Use 'recorder' domain instead of 'history' domain.
Pass purge_days config directly into Recorder object instead of passing
the config object around.
Issue https://github.com/balloob/home-assistant/issues/1337
When purge_days is set under the history component, recorder.py will
delete all events and states that are older than purge_days days ago.
Currently, this is only done once at start up. A vacuum command is
also run to free up the disk space sqlite would still use after deleting
records.
Change the sensor name schema so nodes are not mixed up. The dot that was pressent before was ignored by home-assistant.
Before name: <skeatchname> <node_id><child_id> eg. wall 107
New name : <skeatchname> <node_id> <child_id> eg. wall 10 7
This will result in a Home Assistant Entity ID of: sensor.wall_10_7
When picking which of the high/low temperatures to display as the
"target", it makes more sense to take the outside temperature into
consideration, rather than the current temperature of the thermostat.
If the temperature outside is less than the temperature of the
thermostat, then we are far more likely to end up in "heating" mode
eventually, and vice versa, regardless of where the current inside
temp falls in the range between high and low.
The setup_platform function is trying to get CONF_LATITUDE and CONF_LONGITUDE,
but the validation schema was not accepting these.
Also moved CONF_MONITORED_CONDITIONS and CONF_ELEVATION to homeassistant.const
because they are used in other places.
* Do not propagate API password in service requests.
It makes service validation fail. The choice is to either handle it as an
optional key in every service handler and make sure it doesn't end up in event
stream and notifications, or to strip it as early as possible.
* Some places still need a forwarded api password.
- Event forwarding/remote api uses the local api password to
authenticate against the remote instance.
- The generated index.html at '/' embeds the api password.
* Do not propagate API password in service requests.
It makes service validation fail. The choice is to either handle it as an
optional key in every service handler and make sure it doesn't end up in event
stream and notifications, or to strip it as early as possible.
* Some places still need a forwarded api password.
- Event forwarding/remote api uses the local api password to
authenticate against the remote instance.
- The generated index.html at '/' embeds the api password.
In order to prevent a potential timing attack, it's important to make
sure the password check takes the same amount of time, regardless of
how many characters in the candidate password match the real password.
This commit does increase the verbosity of the authentication check.
Generally it is a good idea for authentication logic to be very clear,
even if that requires some extra verbosity.
* Expanded homematic component with MAX! support via homegear
Also multithreading fixes
* fixed tox errors
* incorporate changes suggested by balloob
* replaced HomematicConfig Container Class with namedtuple
* fixed lint errors
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.
Instead of nested tracebacks, show a simpler error message.
Config directory: /home/user/.homeassistant
ERROR:homeassistant.util.yaml:duplicate key: "script"
in "/home/user/.homeassistant/configuration.yaml", line 95, column 0
in "/home/user/.homeassistant/configuration.yaml", line 108, column 0
Instead of nested tracebacks, show a simpler error message.
Config directory: /home/user/.homeassistant
ERROR:homeassistant.util.yaml:duplicate key: "script"
in "/home/user/.homeassistant/configuration.yaml", line 95, column 0
in "/home/user/.homeassistant/configuration.yaml", line 108, column 0
* We need to allow extra keys on top level componenet config
fixes#1756
* Add comment about location of hass (fixes#1723)
* Fix for MQTT config validation on the protocol field. (#1765)
* Update frontend with weblink fix
* Fix for light service validation. (#1770)
Incorrect validation tested if passed value was a list instead of
a member of the list.
* Accept group without entities in configuration. (#1768)
* Accept group without entities in configuration.
People seem to use these as placeholders for future expansion of their
home automation dreams, and we used to accept them. We still have to
specify at least one of 'name', 'view' or 'icon' so that the group is
parsed as a dictionary.
* Also accept empty entities: key in a group.
* Additional fix for empty entities value in a group config.
* Version bump to 0.17.1
* Accept group without entities in configuration.
People seem to use these as placeholders for future expansion of their
home automation dreams, and we used to accept them. We still have to
specify at least one of 'name', 'view' or 'icon' so that the group is
parsed as a dictionary.
* Also accept empty entities: key in a group.
* Additional fix for empty entities value in a group config.
Two tests were invariably grinding my system to a halt as it was
applying migrations to an empty sqlite database. This patch reduces
the time of a pytest run from 50 to about 16 seconds on my desktop.
The difference is even more noticable on a slower laptop drive, but
is probably insignificant for all you fancy SSD users.
Accept delay configuration even when someone forgets to indent the time
specification.
Also removed 'weeks' and 'microseconds' from acceptable delay values.
There is a new homeassistant release every 2 weeks and running scripts
are not persisting across restarts. And there is still the option of
using (weeks*7) days if the long delay is really necessary.
And if someone really depends on microsecond delay precision we are
unlikely to be able to provide this accuracy, even milliseconds is
suspect for that matter but will at least allow us to specify some
subsecond delay.
vol.IsFile results in an instance of the IsFile method being returned by
the schema validation process. It needs to be called in order to do the
right thing.
The Updater component doesn't make much sense on dev versions. If you
want to run a production config with the updater enabled, you end up
with an 'Update Available' badge pointing you to the last release
version. This change disables the Updater component on dev and updates
the tests to use a faked version number.
A warning is emitted if the Updater component is disabled to ensure
there is no confusion.
This adds an optional 'mac' configuration option to the platform which
is passed to the underlying Orvibo library. The 'mac' option is required
when the switch is connected to a different subnet to the Home Assistant
host
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.
Calculate average download rate the same way as downloadrate
Add config option for choosing which nzbget variables to monitor, and provide a default
Pep8 fixes
Refactoring and changes based on @balloob's comments
Add nzbget.py to .coveragerc omit list. Check if there are any http
errors (like bad auth) when creating the nzbgetapi class. If there
are, the setup_platform() function will return false. Exceptions are
logged as well.
When a new sensor is created, assign the initial value from the api
instead of simply using None until the first update call.
Also fixes a bug where the test when no payload is given succeeds only
because we run the jinja templating out of memory. Sending an empty
payload instead of trying to fix it through validation for now.
* Service validation for MQTT component.
* Fixes for failing mqtt tests.
- Changed behaviour when both 'payload' and 'payload_template' are provided
instead of silently ignoring the payload_template value.
- Have validation accept any type of payload and leave encoding to paho-mqtt.
Allows for testing the zwave network by sending
a no-op command to all the nodes. In theory,
this will also bring back nodes which have been
put in the "presumed dead" state.
If the polling intensity is zero, specifically
disable polling for that device/sub device.
Have zwave startup wait until the zwave
nework is ready (defined by python openzwave docs):
https://python-openzwave.googlecode.com
SIGNAL_NETWORK_AWAKED : all awake nodes are queried. Some sleeping nodes may be missing.
and
You can safely ask node informations when state >= STATE_AWAKED
This appears to make the polling of nodes a bit more deterministic.
Text Update
Additional additions and better support for volume, and mute. Cleanup
Added rxv to requirements_all
Added yamaha.py to .coveragerc
Made uppercase, and removed tabs
Added requirements variable
Added doc string for lint
Removed global variable, and simplified state as per balloobs suggestion
Refactored the component with balloobs suggestions
-Added import in the method
- Only get receiver information on init
- A bit of cleanup
Remove up and down volume
Uneeded as this is handled by set volume instead
Fixed a lint build error
More lint fixes
Removed unused imports
Lint Fixes
Simplified if statement
Minor refactoring since the init calls update.
Fixed lint error
Just variable naming change
Added support for an optional name for the receiver.
Better error handling, a bit of refactoring based on balloobs suggestions
Fixed lint error.
Another lint error fix
Changed raise to return
Disable pylint error handling
Pylint broad exception
Made exception handling in the setup platform instead of the constructor.
Lint error fix
Refactored the way devices are found. This allows for multiple receivers