* Remove devices that no longer exist
* Run Black after merge
* config 2 devices then 1 devices
* clean up device assertions
* More generic device check
* Add request from Honeywell PR
* remove unnecesary test
optimize dont_remove
* remove unnecessary test
* Actually test same id different domain
* Test correct id
* refactor remove test
* Remove .get for non optional keys
* Comprehension for all_device_ids
* Fix DR test, remove `remove`
* fix entities for full test coverage
* remove unused variable assignment
* Additional assertions confirming other domain
* Assertion error
* new method for identifier loop
* device_entries for lists
* ✨ Implement optional API token in config-flow + options
to make the data download from an authenticated path in ESIOS server
As this is an *alternative* access, and current public path works for the PVPC,
no user (current or new) is compelled to obtain a token,
and it can be enabled anytime in options, or doing the setup again
When enabling the token, it is verified (or "invalid_auth" error),
and a 'reauth' flow is implemented, which can change or disable the token if
it starts failing.
The 1st step of config/options flow adds a bool to enable this private access,
- if unchecked (default), entry is set for public access (like before)
- if checked, a 2nd step opens to input the token, with instructions
of how to get one (with a direct link to create a 'request email').
If the token is valid, the entry is set for authenticated access
The 'reauth' flow shows the boolean flag so the user could disable a bad token
by unchecking the boolean flag 'use_api_token'
* ♻️ Remove storage of flag 'use_api_token' in config entry
leaving it only to enable/disable the optional token in the config-flow
* ♻️ Adjust async_update_options
* ✨ Add new price sensors with API token access
New price sensors added:
- Injection price: price of excess energy from self-consumption
- OMIE price: electricity price in the 'open' market
- MAG price: Temporal tax cost for gas compensation
* ✅ Adapt tests to work with multiple sensors
* 🐛 Fix all integration sensors going unavailable
when any sensor lacks data for the current day (usually the 'OMIE price')
* Fix rebase
* Customize icons and display precision for new sensors
* Disable MAG Tax and OMIE price sensors by default
* Move logic to assign sensor unique ids to integration
* Move helper functions to helpers.py
* Fix sensor activation for API download
* Add Valve integration.
This adds the valve integration discussed in https://github.com/home-assistant/architecture/discussions/975
Most of the code is taken from the cover integration but simplified since valves
can't tilt.
There are a couple outstanding errors I'm not sure how to solve and prevents
me from even making this commit without `--no-verify`.
* Apply PR feedback
* Apply more feedback: Intruduce the bare minimum
* Remove file commited by mistake
* Hopefully this fixes tests
* Match cover's typing and mypy settings
* Change some configuration files
* Fix test
* Increase code coverage a little
* Code coverate inproved to 91%
* 95% code coverage
* Coverate up to 97%
* Coverage 98%
* Apply PR feedback
* Even more feedback
* Add line I shouldn't have removed
* Derive closed/open state from current position
* Hopefully last feedback
* Update homeassistant/components/valve/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/valve/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Remove unnecesary translation
* Remove unused method arguments
* Complete code coverage
* Update homeassistant/components/valve/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Simplify tests
* Update homeassistant/components/valve/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Apply last feedback
* Update tests/components/valve/test_init.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update tests/components/valve/test_init.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update tests/testing_config/custom_components/test/valve.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* More feedback
* Apply suggestion
* And more feedback
* Apply feedback
* Remove commented code
* Reverse logic to unindent
* Update homeassistant/components/valve/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/valve/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Implement stop valve for Mock valve
* Fix tests now that I've implemented stop_valve
* Assert it's neither opening nor closing
* Use current position instead
* Avoid scheduling executor when opening or closing
* Fix incorrect bitwise operation
* Simplify toggle
* Remove uneeded partial functions
* Make is_last_toggle_direction_open private
* Remove valve from test custom integration
* Improve test coverage
* Address review comments
* Address review comments
* Address review comments
* Update homeassistant/components/valve/__init__.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update tests
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Erik <erik@montnemery.com>
* Change IR from light to switch
* Remove old entity
* Add test
* Apply suggestions from code review
Co-authored-by: Jan-Philipp Benecke <github@bnck.me>
---------
Co-authored-by: Jan-Philipp Benecke <github@bnck.me>
Reduce overhead connect dispatcher
- We tend to have 1000s (or 10000s) of connected dispatchers which
makes these prime targets to reduce overhead/memory
- Instead of creating new functions to wrap log exceptions each time
use partials which reuses the function body and only create new
arguments
Previous optimizations #103307#93602
* Add device state for additional diagnostics
* Add state test and fix existing tests
* Utilize IntEnum and dict for state lookup
* Update aiounifi to v68
* chore(sunweg): minor requested changes
* test(sunweg): use of fixtures
* feat(sunweg): provide bad auth result on expired authentication
* chore(sunweg): bump version
* chore(sunweg): removed reauth
* chore(sunweg): removed features out of scope
* chore(sunweg): fixtures moved to conftest.py
* chore(sunweg): devicetype moved to const
* chore(sunweg): conftest comment
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
---------
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
* Allow multiple configs.
* Rename test configs.
* Remove unused property
* Merge branch 'dev' into srp_energy_202307.coordinator
* Use title in device name.
* Keep capabilities up to date in the entity registry
* Warn if entities update their capabilities very often
* Fix updating of device class
* Stop tracking capability updates once flooding is logged
* Only sync registry if state changed
* Improve test
* Revert "Only sync registry if state changed"
This reverts commit 1c52571596c06444df234d4b088242b494b630f2.
* Avoid calculating device class twice
* Address review comments
* Revert using dataclass
* Fix unintended revert
* Add helper method
* Use mocked entity platform for lock service tests
* Cleanup old mock class
* Follow up on code review
* Improve mock entity platform
* Use entity_id of passed entity instead of constant
* Add support for Gen3 devices
* Add RPC_GENERATIONS const
* Add gen3 to tests
* More tests
* Add BLOCK_GENERATIONS const
* Use *_GENERATIONS constants from aioshelly
* Adding DataUpdateCoordinator
* Updating and adding test cases
* Optimizing test
* Fix typing
* Prevent speedtest at startup
* Removing typing on Coordinator
* Update homeassistant/components/fastdotcom/coordinator.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Putting back typing
* Update homeassistant/components/fastdotcom/__init__.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Adding proper StateType typing
* Fix linting
* Stricter typing
* Creating proper test case for coordinator
* Fixing typo
* Patching librbary
* Adding unavailable state test
* Putting back in asserts
* Update tests/components/fastdotcom/test_coordinator.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Update tests/components/fastdotcom/test_coordinator.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Update tests/components/fastdotcom/test_coordinator.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Update tests/components/fastdotcom/test_coordinator.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Update tests/components/fastdotcom/test_coordinator.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Coordinator workable proposal
* Update tests/components/fastdotcom/test_coordinator.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Working test cases
* Update tests/components/fastdotcom/test_coordinator.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Update tests/components/fastdotcom/test_coordinator.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Update tests/components/fastdotcom/test_coordinator.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Update tests/components/fastdotcom/test_coordinator.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Fixing tests and context
* Fix the freezer interval to 59 minutes
* Fix test
---------
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Add config flow to Suez water
* fix tests
* Complete coverage
* Change version to 2024.7
* Fix final test
* Add issue when import is successful
* Move hassdata
* Do unique_id
* Remove import issue when entry already exists
* Remove import issue when entry already exists
* Relocate Bluetooth manager to habluetooth library
* Relocate Bluetooth manager to habluetooth library
* Relocate Bluetooth manager to habluetooth library
* fixes
* fix patching time
* fix more tests
* fix more tests
* split
* Bump habluetooth to 0.7.0
changelog: https://github.com/Bluetooth-Devices/habluetooth/compare/v0.6.1...v0.7.0
This is the big change that will move the manager so the HA
PR that will follow this will be a bit larger than the rest of them
since the manager is connected to everything
* fix types
* fix types
* fix types
* fix patch targets
* fix flakey logbook tests (will need another PR)
* mock shutdown
* bump again
* value can be a float now
* Revert "value can be a float now"
This reverts commit b7e7127143.
* float
* Bump openai
* Fix tests
* Apply suggestions from code review
* Undo conftest changes
* Raise repasir issue
* Explicitly use async mock for chat.completions.create
It is not always detected correctly as async because it uses a decorator
* removed duplicated message
* ruff
* Compatibility with old pydantic versions
* Compatibility with old pydantic versions
* More tests
* Apply suggestions from code review
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Apply suggestions from code review
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* refactor: return date/datetime for due date
* fix: explicitly set due date on vTODO component
Using `set_due` automatically handles converting the Python-native
date/datetime values to the correct representation required by RFC5545.
* fix: fix tests with changed due date handling
* fix: item.due may not be a str
* refactor: keep local timezone of due datetime
* refactor: reorder import statement
To make ruff happy.
* fix: fix false-positive mypy error
* First pass at Tessie
* Working POC
* async_step_reauth
* Config Flow tests
* WIP
* Add test requirement
* correctly gen test requirements
* 100% coverage
* Remove remnants of copy paste
* Add TPMS
* Fix docstring
* Remove redundant line
* Fix some more copied docstrings
* Grammar
* Create reusable StrEnum
* Streamline get
* Add a couple more sensors
* Removed need for a model
* Move MODELS
* Remove DOMAIN from config flow
* Add translation strings
* Remove unused parameter
* Simplify error handling
* Refactor coordinator to class
* Add missing types
* Add icon to shift state
* Simplify setdefault
Co-authored-by: J. Nick Koston <nick@koston.org>
* Use walrus for async_unload_platforms
Co-authored-by: J. Nick Koston <nick@koston.org>
* Reformat entity init
Co-authored-by: J. Nick Koston <nick@koston.org>
* Remove Unique ID
* Better Config Flow Tests
* Fix all remaining tests
* Standardise docstring
* Remove redudnant test
* Set TessieDataUpdateCoordinator on entity
* Correct some sensors
* add error types
* Make shift state a ENUM sensor
* Add more sensors
* Fix translation string
* Add precision suggestions
* Move session from init to coordinator
* Add api_key type
* Remove api_key parameter
* Meta changes
* Update TessieEntity and TessieSensor translations
* Goodbye translation keys
* bump tessie-api to 0.0.9
* Fix only_active to be True
* Per vehicle coordinator
* Rework coordinator
* Fix coverage
* WIP
* The grand rework
* Add comments
* Use ENUM more
* Add ENUM translations
* Update homeassistant/components/tessie/sensor.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add entity_category
* Remove reauth
* Remove session
* Update homeassistant/components/tessie/__init__.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add property tag
* Add error text
* Complete config flow tests
* Fix property and rename
* Fix init test
* Reworked coordinator tests
* Add extra checks
* Update homeassistant/components/tessie/__init__.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Update homeassistant/components/tessie/coordinator.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Apply suggestions from code review
Co-authored-by: J. Nick Koston <nick@koston.org>
* Ruff fix
* Update homeassistant/components/tessie/config_flow.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Remove future ENUMs
Co-authored-by: J. Nick Koston <nick@koston.org>
* Ruff fix
* Update homeassistant/components/tessie/config_flow.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Remove reauth and already configured strings
* Lowercase sensor values for translation
* Update homeassistant/components/tessie/__init__.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Fixed, before using lambda
* Add value lambda
* fix lambda
* Fix config flow test
* @bdraco fix for 500 errors
* format
* Add reauth
* Reuse string in reauth
* Ruff
* remove redundant check
* Improve error tests
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* Reload zwave_js config entry on device reset
* remove device
* Just remove the device and don't reload
* revert change to notification message
* Assert device is no longer there
* Remove get_rpc_device_sleep_period() function
* Bump aioshelly version to 7.0.0
* Remove firmware compatibility check from BLE scanner
* Remove firmware compatibility check from light transition
* Update default fw ver
* Use LightEntityFeature in tests
* Supports access to squeezebox server behind https reverse proxy
* Update squeezebox test
* Update homeassistant/components/squeezebox/config_flow.py
Co-authored-by: Robert Resch <robert@resch.dev>
* Update homeassistant/components/squeezebox/config_flow.py
Co-authored-by: Robert Resch <robert@resch.dev>
* Update squeezebox unit tests based on code review
* Migration unit test
* Run black on suggestions accepted in code review
* Apply suggestions from code review
Instead of upgrading squeezebox config, just assume a default of https=False.
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Update test_init.py
Remove migrate entry test since we are no longer migrating
* Delete tests/components/squeezebox/test_init.py
Remove unused test
---------
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Replace apcaccess dependency with async version aioapcaccess
* Upgrade the dependency to the latest version (v0.4.2)
* Handle asyncio.IncompleteReadError
* Add OSO Energy integration
* Add min/max for v40 level and bump pyosoenergyapi to 1.0.2
* OSO Energy address review comments
* Bump pyosoenergyapi to 1.0.3 and remove scan interval
* Remove unnecessary code
* Update homeassistant/components/osoenergy/__init__.py
Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>
* Fixes to latest version
* Add support to set temperature
* Update homeassistant/components/osoenergy/config_flow.py
Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>
* Fixes after review
* Remove unused code
* Add support for translations and modify services
* Apply suggestions from code review
Co-authored-by: Robert Resch <robert@resch.dev>
* Refactor services and constants according to the PR suggestions
* Remove unnecessary code
* Remove unused import in constants
* Refactoring and support for multiple instances
* Apply suggestions from code review
Co-authored-by: Robert Resch <robert@resch.dev>
* Refactor code and apply review suggestions
* Bump pyosoenergyapi to 1.0.5
* Remove services to reduce initial PR
* Remove extra state attributes and make OSO Entity generic
---------
Co-authored-by: Daniel Hjelseth Høyer <github@dahoiv.net>
Co-authored-by: Daniel Hjelseth Høyer <mail@dahoiv.net>
Co-authored-by: Robert Resch <robert@resch.dev>