* Create Opower integration
* fix tests
* Update config_flow.py
* Update coordinator.py
* Update sensor.py
* Update sensor.py
* Update coordinator.py
* Bump opower==0.0.4
* Ignore errors for "recent" PGE accounts
* Add type for forecasts
* Bump opower to 0.0.5
* Bump opower to 0.0.6
* Bump opower to 0.0.7
* Update requirements_all.txt
* Update requirements_test_all.txt
* Update coordinator
Fix exception caused by https://github.com/home-assistant/core/pull/92095
{} is dict but the function expects a set so change it to set()
* Improve exceptions handling
* Bump opower==0.0.9
* Bump opower to 0.0.10
* Bump opower to 0.0.11
* fix issue when integration hasn't run for 30 days
use last stat time instead of now when fetching recent usage/cost
* Allow username to be changed in reauth
* Don't allow changing username in reauth flow
* Migrate Linn / Openhome integration to SSDP config flow
* moved device initialisation into __init__
* wait for user step before adding openhome entities
* add CONFIG_SCHEMA
* cover confirmation step in config flow test
* Address comments
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Implemented Renson integration
* - renamed component to a better name
- Made cleaner code by splitting up files into different one
- Fixed issues regarding getting data from library
- Added service.yaml file
* Added Renson services
* cleanup translations
* added config_flow tests
* changed config_flow, removed all services
* use SensorEntityDescription + introduced new binarySensor
* fixed config_flow test
* renamed renson_endura_delta to renson
* refactored sensors and implemented binary_sensor
* Changed some sensors to non measurement and added entity_registery_enabled_default for config sensors
* Enabled binary_sensor
* changed import to new renamed module
* Merge files into correct files + cleaned some code
* Change use of EntityDescription
* Update codeowners
* Fixed lint issues
* Fix sensor
* Create test.yml
* Update test.yml
* add github action tests
* Format json files
* Remove deprecated code
* Update homeassistant/components/renson/binary_sensor.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Use Coordinqte in Sensor
* Migrated binary sensor to use coordinate
* Removed firmwareSensor
* Add entity_catogory to binary_sensor
* Add services
* Revert "Add services"
This reverts commit 028760d8d8.
* update requirements of Renson integration
* Add services and fan
* Fixed some issue + fixed PR comments
* Cleanup code
* Go back 2 years ago to the bare minimum for PR approval
* Refactored code and added a lot of device classes to the entities
* Fix some bugs
* Add unique Id and some device class
* Show the level value for CURRENT_LEVEL_FIELD instead of the raw data
* Remove FILTER_PRESET_FIELD for now
* Make the _attr_unique_id unique
* Changed Renson tests
* Moved Renson hass data into @dataclass
* Changed test + added files to .coveragerc
* Add device_class=SensorDeviceClass.Duration
* Fix syntax
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Add discovergy integration
* Capitalize measurement type as it is in uppercase
* Some logging and typing
* Add all-time total production power and check if meter has value before adding it
* Add tests for Discovergy and changing therefor library import
* Disable phase-specific sensor per default, set user_input as default for schema and implement some other suggestions form code review
* Removing translation, fixing import and some more review implementation
* Fixing CI issues
* Check if acces token keys are in dict the correct way
* Implement suggestions after code review
* Correcting property function
* Change state class to STATE_CLASS_TOTAL_INCREASING
* Add reauth workflow for Discovergy
* Bump pydiscovergy
* Implement code review
* Remove _meter from __init__
* Bump pydiscovergy & minor changes
* Add gas meter support
* bump pydiscovergy & error handling
* Add myself to CODEOWNERS for test directory
* Resorting CODEOWNERS
* Implement diagnostics and reduce API use
* Make homeassistant imports absolute
* Exclude diagnostics.py from coverage report
* Add sensors with different keys
* Reformatting files
* Use new naming style
* Refactoring and moving to basic auth for API authentication
* Remove device name form entity name
* Add integration type to discovergy and implement new unit of measurement
* Add system health to discovergy integration
* Use right array key when using an alternative_key & using UnitOfElectricPotential.VOLT
* Add options for precision and update interval to Discovergy
* Remove precision config option and let it handle HA
* Rename precision attribute and remove translation file
* Some formatting tweaks
* Some more tests
* Move sensor names to strings.json
* Redacting title and unique_id as it contains user email address
* Add Dremel 3D Printer integration
* remove validators requirement
* ruff
* uno mas
* uno mas
* uno mas
* uno mas
---------
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Tom Harris <tomharris@harrisnj.net>
* Move constant values to separate file
* Move constant values to separate file
* Add config flow to lastfm
* Add tests
* Add config flow to lastfm
* Add tests
* Add tests
* Add tests
* Add extra form for main user and autofill with friends
* Add extra form for main user and autofill with friends
* Add extra form for main user and autofill with friends
* Add extra form for main user and autofill with friends
* Add OptionsFlow
* Add tests
* Fix feedback
* Fix feedback
* Fix feedback
* Fix feedback
* Fix test
* Apply suggestions from code review
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Update config_flow.py
* Update config_flow.py
* Update config_flow.py
* Update homeassistant/components/lastfm/config_flow.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Add tests
* Cleanup
* Update config_flow.py
* Update config_flow.py
* Update config_flow.py
* Fix test
* Fix feedback
* Codeowner lastfm
* Fix feedback
* Fix feedback
* Parametrize errors
* Parametrize errors
* Parametrize errors
* Finish tests
---------
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Update Microsoft TTS supported languages
`script.microsoft_tts` scrapes Microsoft Azure documentation for
the list of supported languages and saves them to
`homeassistant.generated.microsoft_tts` for use in the component.
This adds support for more TTS languages, like fa-ir (Persian).
* Improve xpath query for Microsoft TTS languages
* Remove asserts for Microsoft TTS languages
* Add more tests for Microsoft TTS languages
* Added new integration to support Electra Smart (HVAC)
* fixes + option to set scan interval
* renamed the module to electrasmart and added unittests
* added non tested files to .coveragerc
* changed the usage from UpdateCoordinator to each entity updates it self
* small fixes
* increased pypi package version, increased polling timeout to 60 seconds, improved error handling
* PARALLEL_UPDATE=1 to prevent multi access to the API
* code improvements
* aligned with the new HA APIs
* fixes
* fixes
* more
* fixes
* more
* more
* handled re-atuh flow
* fixed test
* removed hvac action
* added shabat mode
* tests: 100% coverage
* ran hassfest
* Update homeassistant/components/electrasmart/manifest.json
Co-authored-by: Shay Levy <levyshay1@gmail.com>
* Update homeassistant/components/electrasmart/manifest.json
Co-authored-by: Shay Levy <levyshay1@gmail.com>
* Update homeassistant/components/electrasmart/manifest.json
Co-authored-by: Shay Levy <levyshay1@gmail.com>
* Update homeassistant/components/electrasmart/climate.py
Co-authored-by: Shay Levy <levyshay1@gmail.com>
* address Shay's comments
* address Shay's comments
* address more comments
---------
Co-authored-by: Shay Levy <levyshay1@gmail.com>
* Copy openai_conversation to google_generative_ai_conversation
This is to improve diff of the next commit with the actual implementation.
Commands used:
cp -r homeassistant/components/openai_conversation/ homeassistant/components/google_generative_ai_conversation/
cp -r tests/components/openai_conversation/ tests/components/google_generative_ai_conversation/
find homeassistant/components/google_generative_ai_conversation/ tests/components/google_generative_ai_conversation/ -type f | xargs sed -i \
-e 's@openai_conversation@google_generative_ai_conversation@g' \
-e 's@OpenAI Conversation@Google Generative AI Conversation@g' \
-e 's@balloob@tronikos@g'
* Add google_generative_ai_conversation to Google brand
* Google Generative AI Conversation
* Sync recent openai changes
* handle empty responses
* migrated geo_json_events integration to config flow
* improve test coverage
* code reformatting
* fix tests
* fix entity manager
* changes after review
* improve test coverage and fixed form
* remove unused code
* remove commented out code
* changes after review
* make title prettier
* fixed tests
* simplified code
* changes after review
* fix test
* push deprecation out
* changes after review
* changes after review
* changes after review
* changes after review
* changes after review
* removed scan interval from user flow and import flow
* init setup of Anova Sous Vide
* bump anova-wifi to 0.2.4
* Removed yaml support
* Bump to anova-wifi 0.2.5
* Added support for adding sous vide while offline
* Added basic test for sensor
* added better tests for sensors and init
* expanded code coverage
* Decreased timedelta to lowest functioning value.
* Updating my username
* migrate to async_forward_entry_setups
* applying pr recommended changes
* bump anova-wifi to 0.2.7
* Improvements to hopefully get this review ready
* formatting changes
* clean ups for pr review
* remove unneeded unique id check.
* bump ao anova_wifi 0.3.0
* rename device_id to device_unique_id
* renamed to 'anova'
* added unique_id to MockConfigEntry
* removed leftover anova sous vides
* added device id to strings
* added error for incorrect device id
* add has_entity_name
* added attr name for tests
* added authentication functionality
* bump to 0.4.3
* split entity into its own class/object
* pulling firmware version out of async_setup
Co-authored-by: J. Nick Koston <nick@koston.org>
* addressed pr changes
* fixed pytest
* added anova data model
* removed unneeded time change
* add logging in package
* rework step_user
* Update homeassistant/components/anova/sensor.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Removed lower from attr unique id
Co-authored-by: J. Nick Koston <nick@koston.org>
* Removed unneeded member variables in sensor
Co-authored-by: J. Nick Koston <nick@koston.org>
* removed repeated subclass attr
Co-authored-by: J. Nick Koston <nick@koston.org>
* simplify update_failed test
* created descriptionentity
* bump to 0.6.1 limit ws connect
* add translation for sensor entities
* version bump - support pro model
* add anova to strict typing
* fixed sensor not getting datas type
* Apply suggestions from code review
Co-authored-by: J. Nick Koston <nick@koston.org>
* Check for new devices in init
* style changes
* return false instead of config entry not ready
* move serialize_device_list to utils
* move repeating device check into api
* moved unneeded code out of try except
* fixed tests to get 100% cov
* Update homeassistant/components/anova/strings.json
Co-authored-by: J. Nick Koston <nick@koston.org>
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* init roborock commit
* init commit of roborock
* removed some non-vacuum related code
* removed some non-needed constants
* removed translations
* removed options flow
* removed manual control
* remove password login
* removed go-to
* removed unneeded function and improved device_stat
* removed utils as it is unused
* typing changes in vacuum.py
* fixed test patch paths
* removed unneeded records
* removing unneeded code in tests
* remove password from strings
* removed maps in code
* changed const, reworked functions
* remove menu
* fixed tests
* 100% code coverage config_flow
* small changes
* removed unneeded patch
* bump to 0.1.7
* removed services
* removed extra functions and mop
* add () to configEntryNotReady
* moved coordinator into seperate file
* update roborock testing
* removed stale options code
* normalize username for unique id
* removed unneeded variables
* fixed linter problems
* removed stale comment
* additional pr changes
* simplify config_flow
* fix config flow test
* Apply suggestions from code review
Co-authored-by: Allen Porter <allen.porter@gmail.com>
* First pass at resolving PR comments
* reworked config flow
* moving vacuum attr
* attempt to clean up conflig flow more
* update package and use offline functionality
* Fixed errors and fan bug
* rework model and some other small changes
* bump version
* used default factory
* moved some client creation into coord
* fixed patch
* Update homeassistant/components/roborock/coordinator.py
Co-authored-by: Allen Porter <allen.porter@gmail.com>
* moved async functions into gather
* reworked gathers
* removed random line
* error catch if networking doesn't exist or timeout
* bump to 0.6.5
* fixed mocked data reference url
* change checking if we have no network information
Co-authored-by: Allen Porter <allen.porter@gmail.com>
---------
Co-authored-by: Allen Porter <allen.porter@gmail.com>
Co-authored-by: Allen Porter <allen@thebends.org>
* Add dhcp ip update support to onvif
If we know the mac address of the camera we can
update the config entry when the ip changes
* fix lookup
* coverage
* remove unreachable
* remove unreachable
* remove unreachable
* Media playback working
* Working on OPUS audio
* Before rollback
* Fix is_end
* First working pipeline
* Clean up
* Remove asserts
* Send HA version in SDP
* Use async_pipeline_from_audio_stream
* Use config flow with allowed IP
* Satisfy ruff
* Remove use of regex for SIP IP
* Use voip-utils
* Fix imports
* Add Pipeline to __all__
* Fix voice assistant tests
* Basic VoIP test
* Run hassfest
* Generate requirements
* Bump voip utils (missing requirement)
* Allow tts_options to be passed in to pipeline run
* Add config flow tests
* Update test snapshots
* More tests
* Remove get_extra_info
* Appeasing the codebot
* Android TV Remote integration
* Add diagnostics
* Remove test pem files from when api was not mocked
* Address review comments
* Remove hass.data call in test
* Store the certificate and key in /config/.storage
* update comments
* Update homeassistant/components/androidtv_remote/__init__.py
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* import callback
* use async_generate_cert_if_missing
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Add DHCP discovery to Obihai
* Unique ID is MAC
* Move try blocks, cleanup
* Migrate existing unique_ids
* Use PyObihai to update Unique ID
* Auth then use get_device_mac
* Config flow changes
* Reworking flow according to feedback
* Cleanup
* Initial commit
* Add websocket test tool
* Small tweak
* Tiny cleanup
* Make pipeline work with frontend branch
* Add some more info to start event
* Fixes
* First voice assistant tests
* Remove run_task
* Clean up for PR
* Add config_flow.py
* Remove CLI tool
* Simplify by removing stt/tts for now
* Clean up and fix tests
* More clean up and API changes
* Add quality_scale
* Remove data from run-finish
* Use StrEnum backport
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Added config_flow for edl21.
* Added already_configured check.
* Added config_flow test
* Added setup of the edl21 from configuration.yaml
* Ran script.gen_requirements_all
* Removed the generated translation file.
* Added a deprecation warning when importing from configuration.yaml.
* Readded the platform schema.
* Added handling of optional name for legacy configuration.
* Fixed handling of default value in legacy configuration.
* Added duplication check entries created via legacy config.
* Apply suggestions from code review
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Apply suggestions from code review
* Apply suggestions from code review
* Apply suggestions from code review
* Apply suggestions from code review
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Apply suggestions from code review
---------
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Refactor zeroconf task handling
- Avoid the need to create tasks for most callbacks
- Fixes the untracked task that could get unexpectedly GCed
* be consistant
* be consistant
* fix zeroconf tests
* runtime
* Revert "runtime"
This reverts commit 19e6b61837.
* precalc
* refactor
* tweak
* update tests
* TP-Link Omada integration
Support for PoE config of network switch ports
* Bump omada client version
* Fixing tests
* Refactored site config flow
* Code review comments
* Fixed tests and device display name issue
* Bump isort to fix pre-commit hooks
* Hassfest for the win
* Omada code review
* Black
* More config flow test coverage
* Full coverage for omada config_flow
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Fix IoT Class for Torque plugin
This is currently misclassified:
- There is no "Torque" server, the Torque plugin is the server that receives data directly from the client. It should be `local` instead of `cloud`.
- The client sends data to the server as needed. This plugin will NOT poll for data. It should be `push` instead of `poll`.
* Run hassfest
Co-authored-by: Franck Nijhof <git@frenck.dev>
* Rainbird config flow
Convert rainbird to a config flow. Still need to handle irrigation numbers.
* Add options for irrigation time and deprecate yaml
* Combine exception handling paths to get 100% test coverage
* Bump the rainird config deprecation release
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Remove unnecessary sensor/binary sensor and address some PR feedback
* Simplify configuration flow and options based on PR feedback
* Consolidate data update coordinators to simplify overall integration
* Fix type error on python3.9
* Handle yaml name import
* Fix naming import post serialization
* Parallelize requests to the device
* Complete conversion to entity service
* Update homeassistant/components/rainbird/switch.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/rainbird/config_flow.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Remove unused import
* Set default duration in options used in tests
* Add separate devices for each sprinkler zone and update service to use config entry
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* redo Add sensor
* move back to ClientError
simplify washer_state
* Cleanup Sensor definitions
* Seperated EndTimeSensor
* Clean up WasherDryerTimeClass
* Start with Timestamp = None
* Clean up class description
* One more ClientError
* change to restore sensor
* Don't update when no state change
* Seperate washer tests
Add restore_state test
* Remove unused loop in washer sensor test
* No loops in sensor tests
* Remove unnecessary SensorTestInstance
* Recognize more SSDP friendly names as "ours"
* Trigger on SoyeaLink devices
* Pass discovered URL through context, it does not persist via user_input
* Use manufacturer from SSDP
* Actually use serial number if available, update URL for configured
* Remove heuristic friendly name filtering against non-LTE devices
* Copy google_sheets to google_assistant_sdk
This is to improve diff of the next commit with the actual implementation.
Commands used:
cp -r homeassistant/components/google_sheets/ homeassistant/components/google_assistant_sdk/
cp -r tests/components/google_sheets/ tests/components/google_assistant_sdk/
find homeassistant/components/google_assistant_sdk/ tests/components/google_assistant_sdk/ -type f | xargs sed -i \
-e 's@google_sheets@google_assistant_sdk@g' \
-e 's@Google Sheets@Google Assistant SDK@g' \
-e 's@tkdrob@tronikos@g'
* Google Assistant SDK integration
Allows sending commands and broadcast messages to Google Assistant.
* Remove unnecessary async_entry_has_scopes check
* Bump gassist-text to fix protobuf dependency
* Add matter base (#79372)
Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
* Add matter server add-on flow (#82698)
* Add matter server add-on flow
* Fix stale error argument
* Clean docstrings
* Use localhost as default address
* Add matter websocket api foundation (#82848)
* Add matter config entry add-on management (#82865)
* Use matter refactored server/client library (#83003)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Bump python-matter-server to 1.0.6 (#83059)
* Extend matter websocket api (#82948)
* Extend matter websocket api
* Finish docstring
* Fix pin type
* Adjust api after new client
* Adjust api to frontend for now
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Allow configuring country and language in core config
* Add script for updating list of countries
* Use black for formatting
* Fix quoting
* Move country codes to a separate file
* Address review comments
* Add generated/countries.py
* Get default language from owner account
* Remove unused variable
* Add script to generate list of supported languages
* Add tests
* Fix stale docsring
* Use format_python_namespace
* Correct async_user_store
* Improve typing
* Fix with_store decorator
* Initialize language in core store migration
* Fix startup
* Tweak
* Apply suggestions from code review
Co-authored-by: Franck Nijhof <git@frenck.dev>
* Update storage.py
Co-authored-by: Franck Nijhof <git@frenck.dev>
* Create repairs issue if an outdated currency code is configured
* Add script for updating list of currencies
* Use black for formatting
* Move currency codes to a separate file
* Address review comments
* Added initial files for air-Q integration
* Allow FIXME comments in pylint (temporary)
Also reintroduce --ignore-missing-annotations=y
* Set up air-q entry to connect to aioairq's API (initial attempt)
Also add necessary constants
* Implement a class for sensors and its update logic
Very early stage, WIP
* Zeroconf and authentication are working
* Complete the bare-bone minimal working version
Specifically, make AirQSensor update its values.
* Handle invalid authentication gracefully
* Handle ClientConnectionError gracefully
* Add field hint for the login form
The key in the schema, which defines the form in
`ConfigFlow.async_show_form` is looked up in both `airq/strings/json`
and `airq/translations/en.json`. I am still not 100% sure how this
lookup is performed. WIP
* Minor cleanups
* Extend sensor list to all supported by SensorDeviceClass
Also manage warming up sensors
* aioairq is published to PyPI and mentioned in requirements
* Reordered constants and list content alphabetically
As required by style guides. Also turned SENSOR_TYPES to a list
* Updated file docstrings for a dev unfamiliar w/homeassistant like myself
* Adding a bit of logging for the integration setup process
* Expose scan interval & smoothing flag
Also streamline test_authentication in config_flow.
* Fix a type annotation mistake
* Use as many constants from homeassistant.const as possible
My only concern is using CONST_IP_ADDRESS = "ip_address" for smth which
stands for both IP address and mDNS...
* Temporarily rollback ConfigFlow.async_step_configure and use defaults
TODO: implement OptionFlowHandler instead
* Define custom Coordinator, w subset of airq config
The latter is then accessed from entity / sensor constructors to define
correct DeviceInfo
* Provide translations to de & fr + minor changes to en
* Provide translations to ru + a minor en changes
* Make translation a little more helpful and polite
* Fix devicename and entry title
* Remove stale commented out code
* Test config_flow
At this point two helper functions which interact with the external
library are not tested
* Clean up unrelated and meant as temporary changes
* Clean up unnecessary comments meant for internal use
* Move fetching config to a dedicated async coordinator method
As opposed to it being a potentially poorly justified step in
async_setup_entry
* Remove zeroconf support since it is not yet ready
* Remove translations other than en
* Remove unnecessary comments, manifest.json entries, and constants
* Improve exception handling
- `_LOGGER` uses `debug` and not `error` levels.
- Drop `ClientConnect` and catch `aiohttop.ClientConnectError` directly
- Drop `Exception` as it is not expected from `aioairq` (remove the
corresponding test too)
* Drop strings for obsolete errors and steps
Specifically, `unknown` error isn't caught any more. `configure` step
has also been removed.
* Refactor en.json to be consistent with strings.json
* Move target_route from a coordinator argument to a constant
At this point a user cannot configure the target_route route, thus it
does not make sense to expose it half-heartedly in
`AirQCoordinator.__init__`, since it cannot be accessed.
* Fix an async call in `AirQCoordinator.async_setup_entry`
* Refactor underlying aioairq API
- Use `homeassistant.helpers.aiohttp.async_get_clientsession` and pass a
single persistent session to `aioariq.AirQ.__init__`
- `aioairq.AirQ.fetch_device_info` now returns a `DeviceInfo` object heavily
inspired and almost compatible with `homeassistant.helpers.entity.DeviceInfo`.
Make heavier use of this object and define a single `DeviceInfo` in the
`AirQCoordinator` (instead of recreating the same object for each sensor
of the device in `sensor.AirQSensor`)
- Drop two helper functions in `config_flow.py` and operate on `aioariq.AirQ`
methods directly
* Fix the version of aioairq
* Add 15 more sensors + icons
* Remove cnt* & TypPS, change units of health & performance
* Add 12 more sensors
* Add a missing icon
* Gracefully handle device not being available on setup
If the device and the host are not on the same WiFi,
ServerTimeoutError is raised, which is caught by
ClientConnectionError.
If the device is powered off, ClientConnectionError is expected.
In both cases, ConfigEntryNotReady is raised, as prescribed by the docs.
Newer version of aioairq times-out far quicker than the default 5 mins.
* Rename two sensors
* Validate provided IP address / mDNS
aioairq now raises InvalidInput if provided IP / mDNS does not seem
valid. Handle this exception correctly
* Apply suggestions from code review
Clean up the comments and rename the logger
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Artem Draft <Drafteed@users.noreply.github.com>
* Only fetch device info during the first refresh
- Fetched info is stored in AirQCoordinator.device_info.
- In `AirQSensor.native_value` only multiply by the factor if
the sensor reading is not None
- Fix the tests for ConfigFlow for aioairq==0.2.3. Specifically
make the dummy data pass the new validation step upstream
+ add a test which fails it
* Drop custom device classes for now
* Apply suggestions from code review
Co-authored-by: Artem Draft <Drafteed@users.noreply.github.com>
* Only fetch device info during ConfigFlow.async_step_user
Store the result obtained by `airq.fetch_device_info` it in
`config_entry.data`. Pass the entire config entry to `AirQCoordinator`
and build the entire `homeassistant.helpers.entity.DeviceInfo` in the
`AirQCoordinator.__init__`. This makes
`AirQCoordinator._async_fetch_device_info` and overloaded
`AirQCoordinator._async_config_entry_first_refresh` obsolete.
Bump aioairq version.
Turn update_interval from `AirQCoordinator.__init__` argument into a
contestant.
* Custom entity description exposing a hook to modify sensor value
Use a `AirQEntityDescription` with a callable `value_fn` which allows to
change the sensor value retrieved from the device. Note that the
callable does not handle data retrieval itself (even from
`coordinator.data`). Instead it is purely a hook to transform obtained
value.
* Avoid duplicated use of unique_id
Device info is fetched during the `ConfigFlow.async_user_step`.
`unique_id` is taken from the device info and is **not** stored
in `config_entry.data`. Subsequently `config_entry.unique_id` is
used instead.
* Drop unnecessary try-except
Co-authored-by: Artem Draft <Drafteed@users.noreply.github.com>
* Clarify the use of value_transform_fn
* Refactor the use of lambdas in AirQEntityDescription
Now it is the job of the callable under `value` to get the sensor
reading from the coordinator's data. Factoring this functionality into a
callback decouples the key of the description from the key of dict,
returned by the API, so `AirQEntityDescription` no longer requires its key
to be set to smth clearly internal (e.g. `nh3_MR100`).
* Use a callback to update native_value
Since all `native_value`s are updated synchronously, it can as well be
done in a callback for better state consistency (right?)
* Revert the description keys to match data keys
Must match given the current way of identifying available sensors. On a
broader scale, they must match to be able to relate the descriptions to
sensors, unless a separate lookup table is maintained.
* Reduce number of loops when adding sensors
Filtering warming up sensors and non-sensor keys can be combined with
adding entities.
* Remove obsolete imports
* Update integrations.json
* Add integration_type
Integration supports multiple devices => hub
Co-authored-by: dl2080 <daniel.lehmann@runbox.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Artem Draft <Drafteed@users.noreply.github.com>
Co-authored-by: Daniel Lehmann <43613560+dl2080@users.noreply.github.com>
Co-authored-by: Martin Selbmann <job@martin-selbmann.de>
* mapping
* update
* working
* tests
* fixes
* temp add binary sensor platform to make sure it works
* fixes
* 100% cover
* adjust
* disable chatty sensors by default
* remove binary sensor_platform for next PR
* time is much nicer than counter