* Squeezebox add config flow and player discovery
* Fixes to config flow
* Unavailable player detection and recovery
* Improved error message for auth failure
* Testing for squeezebox config flow
* Import configuration.yaml
* Support for discovery integration
* Internal server discovery
* Fix bug restoring previously detected squeezebox player
* Tests for user and edit steps in config flow
* Tests for import config flow
* Additional config flow tests and fixes
* Linter fixes
* Check that players are found before iterating them
* Remove noisy logger message
* Update requirements_all after rebase
* Use asyncio.Event in discovery task
* Use common keys in strings.json
* Bump pysqueezebox to v0.2.2 for fixed server discovery using python3.7
* Bump pysqueezebox version to v0.2.3
* Don't trap AbortFlow exception
Co-authored-by: J. Nick Koston <nick@koston.org>
* Refactor validate_input
* Update squeezebox tests
* Build data flow schema using function
* Fix linter error
* Updated en.json
* Update homeassistant/components/squeezebox/media_player.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/squeezebox/media_player.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/squeezebox/media_player.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/squeezebox/media_player.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update .coveragerc for squeezebox config flow test
* Mock TIMEOUT for faster testing
* More schema de-duplication and testing improvements
* Apply suggestions from code review
Co-authored-by: J. Nick Koston <nick@koston.org>
* Testing and config flow improvements
* Remove unused exceptions
* Remove deprecated logger message
* Update homeassistant/components/squeezebox/media_player.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Implement suggestions from code review
* Add async_unload_entry
* Use MockConfigEntry in squeezebox tests
* Remove unnecessary config schema
* Stop server discovery task when last config entry unloaded
* Improvements to async_unload_entry
* Fix bug in _discovery arguments
* Do not await server discovery in async_setup_entry
* Do not await start server discovery in async_setup
* Do not start server discovery from async_setup_entry until homeassistant running
* Re-detect players when server removed and re-added without restart
* Use entry.entry_id instead of unique_id
* Update unittests to avoid patching homeassistant code
Co-authored-by: J. Nick Koston <nick@koston.org>
* Refactor / update Awair integration
This commit does a few things, all in service of making the Awair
integration more modern and reliable. Specifically we do the following:
- Update to python_awair 0.1.1
- Begin using config entries / flow for setting up the integration.
- YAML support is completely removed.
- The integration now allows adding multiple Awair accounts, should a
user wish to do so (I found it _very_ useful in development).
- Group various Awair sensors into devices, using the device registry.
- Renames various sensors and treats the "dust" sensor as a particulate sensor.
- Device update rate-limits are no longer dynamically calculated; the
Awair API now separates rate-limits on a per-device basis.
- Supports sound pressure and illuminance sensors found on some Awair devices.
- We report the "awair index" for certain sensors as part of device_state_attributes.
The "index" is a subjective measure of whether or not a sensor reading
is "good" or "bad" (and to what extent). It's a component of the Awair
score, and it is useful on its own as an input for those who wish to
do things like "display this color if the value is 'bad'".
This is a breaking change, and requires updates to documentation and a
warning in the README. The breaking changes in detail, are:
- Support for all YAML configuration is removed, and users will need to
re-add the integration via the UI.
- We no longer support overriding device discovery via manual
configuration of device UUIDs. This was previously supported because
the Awair API had severe limits on the device list endpoints; however
those have since been removed.
- Gen 1 devices no longer show a "dust" sensor; rather we create a PM2.5
sensor and a PM10 sensor and just keep the values in sync. This better
reflects the sensor capabilities: it can detect particles in a range
from 2.5 -> 10, but cannot differentiate between sizes.
- Sensors are renamed as follows:
- "sensor.devicename_co2" -> "sensor.devicename_carbon_dioxide"
- "sensor.devicename_voc" -> "sensor.devicename_volatile_organic_compounds"
- "sensor.devicename_score" -> "sensor.devicename_air_quality_index"
- I've chosen to call the "Awair Score" an "air quality index" sensor,
because fundamentally the "Awair Score" and other air quality indices
(such as CAQI) do the same thing: they calculate a value based on a
variety of other inputs.
Under the hood, the integration has seen some improvements:
- We use the DataUpdateCoordinator class to handle updates, rather than
rolling our own update class.
- The code no longer tracks availability based on a timestamp returned
from the Awair service; we assert that if we have received a response
and the response has data for our device, then we are available (and
otherwise, not available). We don't need to test the actual Awair API
so heavily.
- Test coverage has been expanded to handle a variety of products that
Awair produces, not just the one I happen to own.
- Test coverage no longer concerns itself with testing behavior that is
now handled by the DataUpdateCoordinator; nor is it concerned with
ensuring that the overall component sets up and registers properly.
These are assumed to be well-tested functionaity of the core and not
things we need to re-test ourselves.
Finally - between library updates and integration updates, this
integration is well-positioned to support future updates. I have a
proof-of-concept patch for device automations, and the underlying
library now supports subclassing authentication (which clears the way
for us to use OAuth authentication for Awair).
* Wrap test fixture in mock_coro
Truthfully I'm not sure why this was passing on my local dev
environment, but I was developing with python 3.8 before. After
installing python 3.7, I was able to reproduce the CI failures and fix
them.
* Fix broken tests after #34901 and/or #34989
* Do not rename sensors so broadly
We're going to keep the sensors named as they were before, pending the
outcome of any decisions around the air_quality component and what names
should be standardized for air-quality-like devices.
If standardized names are selected (which does seem likely), then we
will update this integration to match them - at which point, it would be
a breaking change.
But for now, we'll keep names mostly identical to what users had before.
Notable in this commit is that we generate the entity_id ourselves,
rather than just allowing it to be auto-generated from the name
attribute. This allows us to provide more human friendly names, while
keeping the old format for entity ids. For example, given an Awair
device called "Living Room", we'll generate an entity id of
"sensor.living_room_voc" but show set the name of the device to "Living
Room Volatile organic compounds".
* Support import from config.yaml
We'll create a config entry from config.yaml the first time we're
loaded, and then defer to it from then on.
We ignore all keys other than the access_token, since we no longer need
to deal with per-account rate-limits (rather, everything is per-device
now).
* Add myself to CODEOWNERS
Since I wrote the initial integration, and now this re-write, it feels
appropriate for me to take care of the integration along with `danielsjf`.
* Remove name mangling
* Update homeassistant/components/awair/manifest.json
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/awair/config_flow.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/awair/sensor.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/awair/sensor.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Address some review feedback
* Set up reauth flow in a job, rather than awaiting
* Remove unnecessary title string
* Remove unnecessary config schema checking
As pointed out in review, because this comes in via import from
`configuration.yaml`, we can rely on the `PLATFORM_SCHEMA` validation instead.
* Fix tests
* Set unique_id appropriately for legacy devices
For users who have had this integration already installed (and who have
updated their home assistant installation sometime in recent history),
we want to ensure that unique_id's are set to the same thing as before,
to facilitate the upgrade process.
To do that, we add an additional property to the `SENSOR_TYPES` dict
(`ATTR_UNIQUE_ID`) which allows us to map modern sensor names from
python_awair to what older versions called them - ie: `humidity` ->
`HUMID`. We then use that value when constructing the unique ID. This
should allow users to upgrade and not lose configuration even if entity
IDs would otherwise change (because we have changed the name format that
generates entity IDs).
One note is that for the gen1 `DUST` sensor, we have to treat it
differently. This integration used to call that a "PM2.5" sensor, but
the unique_id generated would be something like `awair_12345_DUST`. So
we special-case that sensor, and do the same thing. We do not need to
special-case the PM10 sensor for gen1 devices, because we didn't create
a PM10 sensor in the past (we do now, because the "DUST" sensor is
really a hybrid PM2.5/PM10 sensor).
* Patch async_setup_entry for two tests
* Update awair config_flow to require / use an email address for unique_id
Also, only start one re-auth flow.
* Add a few more tests, try to get coverage up.
* Add another test
* Move attribution to device_state_attributes
* Don't require email
* Switch from Union[dict, None] to Optional[dict]
* Use a mock where requested
* Fix missing constant rename
* Use async_create_task
* Bump test coverage a bit for config_flow
* s/CONF_UNIQUE_ID/UNIQUE_ID/g
* Add warning about deprecated platform config
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Allow activity change on start of switch
Allow activity to be updated when a switch to a new activity is initiated instead of when it is completed.
* Updates based on feedback
Some items are not required to be done as YAML is not used anymore.
Cleaned-up some code.
* Fix for change on how to set callbacks
How callbacks are set now one has to set the new_activity and new_activity_starting as well, even just with None.
* Added callback update
Added so that when it is changed in the UI the callbacks will be changed as well.
* Added test cases for notify setting
Added test cases for config flow to test new setting for activity notifications.
* Vera now polls for all status data, no only incremental.
Vera polling is not handled using hass event loops with proper backoffs.
* Using long polling.
* Addressing PR feedback.
* Addressing PR feedback.
Adding controller stop on config unload.
* Bump python-synology to 0.8.2
* state_attributes to device_state_attributes
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Add config_flow to the dunehd integration
* Add tests
* Run gen_requirements_all
* Fix pylint error
* Better hostname validation
* Build device info in the class
* Improve configuration
* Read new properties for basic device information
Improve tests by mocking less improving stability of tests
* Clean up in device tests
* Support new port management api
* Improve initializing data
* Bump dependency to v28
* Requires 0.7.18 of elkm1 library to decode LD messages, and uses those messages to reliably set the arming/disarming user when there are more than one area. See https://github.com/home-assistant/core/issues/35310.
* Fixed typo
* Fixed off by one error -- LD command reports 1-based user-numbers which is the changed_by_id we want, but we need 0-based indices as argument to username.
* Bump required version of elkm1, remove logging message I was using for testing; prepping for PR.
* Black formatted
* Fixed bug whereby I needed to ref elements when running against released build of elkm1-lib
* Update plugwise async, config_flow and multi entity
* Update battery percentage
* Fix yamllint on services
* Fix yamllint on services
* Fix formatting for pyupgrade
* Update homeassistant/components/plugwise/__init__.py
Co-Authored-By: Robert Svensson <Kane610@users.noreply.github.com>
* Add try/except on setup
* Bump module version, battery version and valve position
* Removing sensor, switch, water_heater for later (child) PRs
* Catchup and version bump
* Remove title from strings.json
* Readd already reviewd await try/except
* Readd already reviewed config_flow
* Fix pylint
* Fix per 0.109 translations
* Remove unused import from merge
* Update plugwise async, config_flow and multi entity
* Update battery percentage
* Fix yamllint on services
* Fix yamllint on services
* Bump module version
* Bump module version, battery version and valve position
* Removing sensor, switch, water_heater for later (child) PRs
* Catchup and version bump
* Remove title from strings.json
* Fix pylint
* Fix per 0.109 translations
* Translations and config_flow, module version bump with required changes
* Translations and config_flow, module version bump with required changes
* Fix requirements
* Fix requirements
* Fix pylint
* Fix pylint
* Update homeassistant/components/plugwise/__init__.py
Improvement
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/plugwise/__init__.py
Improvement
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/plugwise/__init__.py
Improvement
Co-authored-by: J. Nick Koston <nick@koston.org>
* Include configentrynotready on import
* Update __init__.py
* DataUpdateCoordinator and comment non-PR-platforms
* Fix reqs
* Rename devices variable in favor of entities
* Rework updates with DataUpdateCoordinator
* Peer review
* Peer review second part
* Cleanup comments and redundant code
* Added required config_flow test
* Peer review third part
* Update service was replaced by DataUpdateCoordinator
* Corrected testing, version bump for InvalidAuth, move uniq_id
* Remove according to review
* Await connect (py38)
* Remove unneccesary code
* Show only when multiple
* Improve config_flow, rename consts
* Update homeassistant/components/plugwise/climate.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/plugwise/climate.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Process review comments
Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add support for Elexa Guardian water valve controllers
* Zeroconf + cleanup
* Sensors and services
* API registration
* Service bug fixes
* Fix bug in cleanup
* Tests and coverage
* Fix incorrect service description
* Bump aioguardian
* Bump aioguardian to 0.2.2
* Bump aioguardian to 0.2.3
* Proper entity inheritance
* Give device a proper name
* Code review
* add tests
* better error handling in dependency
* dont suppress errors
* add support for multiple devices
* add test for Unauthorized status
* raise error on service call failure
* Working PoC
* Store
* Handle subscribing to MQTT and stopping stream when first telegram arrives
* Improve naming
* Now with test
* Better strings
* Fix Martins comments
* Improve mock device patching
* Bump dependency to v27
Add MQTT as after dependency
* Update to garminconnect 0.1.13
This will fix body composition sensors being unavailable
* Update requirements_all to garminconnect 0.1.13
* Update requirements_test_all.txt
* First cut of Rollease Acmeda Pulse Hub integration.
* Acmeda integration improvements:
- Moved common code into a base entity
- Battery level sensor added
- Localisation now working
* Added requirement for aiopulse now that it has been uploaded to PyPI.
* Exclude acmeda integration from coverage check as it relies on a hub being present.
* Fix Travis CI build issues.
* Remove unused constants.
* Remove unused group logic from cover.py
* Removed commented code from base.py
* Remove sensors (battery entities) on removal of hub.
* Remove unused groups from sensor.py
* Acmeda device and entity update made fully asynchronous using subscriptions to remove need for config polling.
* Updated aiopulse version dependency.
Removed non-functional battery charging indication.
* Rationalised common code to update entities into helpers.py
* Fix linting issue.
* Correct additional CI pylint errors.
* Index config_entries by entry_id.
Move entity loading and unloading to __init__.py
Add entry_id to dispatcher signal
Removed now unused polling code hub
Added config_flow unit tests
* Tweak to integration config_entry title.
* Bumped aiopulse module to 0.3.2.
Reduced verbosity of aiopulse module.
* Changed to using direct write of device state.
Removed old style async_step_init config_flow step.
* Remove superfluous battery_level and device_state_attributes from battery entity.
* Removal of unused strings.
Removal of unused create_config_flow helper.
Removal of stale comment.
* Remove use of shared container to track existing enities.
Moved removal and deregistration of entities to base class through use of dispatch helper.
* Fixed strings.json
* Fix incorrect use of remove instead of pop on dict.
* Add support for tilting covers, bump aiopulse version number.
* Bump aiopulse version to v0.3.4.
Fixed bug in cover supported_features.
* Bumped aiopulse version to 0.4.0
Update acmeda .coveragerc exclusions
* Removed already configured hub check from __init__.py async_setup_entry
Removed passing in hass reference to base entity class
Renamed entity async_reset to async_will_remove_from_hass
Changed device_info and properties
Migrated to CoveEntity from CoverDevice
Added dispatched_connect cleanup on hub removal
Removed unused entries from manifest
Removed override of battery icon
Renamed translations folder
* Reversed unintended change to .coveragerc
* Fixed config flow for multi-hub discovery.
* Acmeda enhancements as requested by MartinHjelmare
* Force import to connect to hub to retrieve id prior to creating entry
* Remove YAML configuration support.
* Tidied up config_flow and tests:
- removed unnecessary steps
- fixed typos
* Removed storage of hub in config_flow.
* Add config flow to gogogate2 component.
* Using a more stable gogogate api.
* Getting config flows working better by using different downstream library.
* Fixing options not getting default values.
Adding availability to cover entity.
* Simplifying return types of function.
* Address PR feedback.
* Making user config flow not abort.
* Using DataUpdateCoordinator.
* Addressing PR feedback.
* Using standard method for using hass.data
* Split auth fail test into separate tests.
* New forked_daapd component
* Bunch of changes
Add config flow and zeroconf
Add zones on callback when added by server
Add password auth
Add async_play_media for TTS
Add media_image_url
Add support for pipe control/input from librespot-java
Improve update callbacks
* Refactor as per code review suggestions
Move config_flow connection testing to pypi library (v0.1.4)
Remove use of ForkedDaapdData class
Decouple Master and Zone data and functions
Add updater class to manage websocket and entity updates
* More changes as per code review
Avoid direct access to entities in tests
Bump pypi version
Mark entities unavailable when websocket disconnected
Move config tests to test_config_flow
Move full url creation from media_image_url to library
Move updater entity from master to hass.data
Remove default unmute volume option
Remove name from config_flow
Remove storage of entities in hass.data
Use async_write_ha_state
Use signal to trigger update_options
Use unittest.mock instead of asynctest.mock
* Yet more changes as per code review
Add more assertions in tests
Avoid patching asyncio
Make off state require player state stopped
Only send update to existing zones
Split up some tests
Use events instead of async_block_till_done
Use sets instead of lists where applicable
Wait for pause callback before continuing TTS
* Remove unnecessary use of Future()
* Add pipes and playlists as sources
* Add support for multiple servers
Change config options to add max_playlists+remove use_pipe_control
Create Machine ID in test_connection and also get from zeroconf
Modify hass.data storage
Update host for known configurations
Use Machine ID in unique_ids, entity names, config title, signals
* Use entry_id as basis for multiple entries
* Use f-strings and str.format, abort for same host
* Clean up check for same host
* Add integration for wiffi devices
wiffi devices are DIY board manufactured by stall.biz.
Several devices are available, e.g. a weather station (weatherman), an
indoor environmental sensor (wiffi-wz) and some more.
This intgration has been developed using a weatherman device, but should
also work for other devices from stall.biz.
* Fix pylint warning
* Use WIFFI / STALL WIFFI instead of wiffi to be consistent with stall.biz
* Don't update disabled entities.
* fix complains
- move wiffi specific code to pypi
- remove yaml configuration code
* incorporate various suggestions from code review
* fix remaining comments from Martin
* fix comments
* add tests for config flow
* fix comments
* add missing requirements for tests
* fix pylint warnings
* fix comments
* fix comments
remove debug log
rename .translations to translations
* rebase and adapt to latest dev branch
* Update homeassistant/components/wiffi/config_flow.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/wiffi/config_flow.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* fix missing import
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Use helper functions for exception handling
* Create a separate class to handle communication with the device
* Update manifest
* Use coroutine for service setup
* Fix sensor update
* Update tests
* Fix MP1 switch
* Add device.py to .coveragerc
* Remove unnecessary blocking from test_learn_timeout
* Change access method for entries with default values
* Make the changes suggested by MartinHjelmare
* Remove dot from debug message
* Use underscore for unused variable
When the websocket is created `SSLContext.load_default_certs` is called
each time which opens up the system default ssl certs file and reads it in
Normally this goes unnoticed, however since there are frequent connects
and disconnects of the websocket it was noticeable.
* Update requirements_all.txt
Updated to vigilancemeteo version 3.0.1
* Update requirements_test_all.txt
Updated to vigilancemeteo version 3.0.1
* Update manifest.json
Update to correct typo error