* Add OPNSense device_tracker
This commit adds a new component for using an OPNSense router as a
device tracker. It uses pyopnsense to query the api to look at the
arptable for a list of devices on the network.
* Run black formatting locally to appease azure
* Apply suggestions from code review
Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>
* Fix issues identified during code review
This commit updates several issues found in the module during code
review.
* Update homeassistant/components/opnsense/__init__.py
Co-Authored-By: Fabian Affolter <mail@fabian-affolter.ch>
* Update CODEOWNERS for recent changes
* Fix lint
* Apply suggestions from code review
Co-Authored-By: Martin Hjelmare <marhje52@kth.se>
* More fixes from review comments
This commit fixes several issues from review comments, including
abandoning all the use of async code. This also completely reworks the
tests to be a bit clearer.
* Revert tests to previous format
* Add device detection to opnsense device_tracker test
This commit adds actual device detection to the unit test for the setup
test. A fake api response is added to mocks for both api clients so that
they will register devices as expected and asserts are added for that.
The pyopnsense import is moved from the module level to be runtime in
the class. This was done because it was the only way to make the
MockDependency() call work as expected.
* Rerun black
* Fix lint
* Move import back to module level
* Return false on configuration errors in setup
This commit updates the connection logic to return false if we're unable
to connect to the configured OPNsense API endpoint for any reason.
Previously we would not catch if an endpoint was incorrectly configured
until we first tried to use it. In this case it would raise an unhandled
exception. To handle this more gracefully this adds an api call early in
the setup and catches any exception raised by that so we can return
False to indicate the setup failed.
* Update tests
* Add pyopnsense to test requirements
* Rerun gen_requirements script
* Fix failing isort lint job step
Since opening the PR originally yet another lint/style checker was added
which failed the PR in CI. This commit makes the adjustments to have
this pass the additional tool's checks.
* Fix comment
* Update manifest.json
Co-authored-by: Fabian Affolter <mail@fabian-affolter.ch>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Pascal Vizeli <pascal.vizeli@syshack.ch>
* Rewrite of Spotify integration
* Update homeassistant/components/spotify/config_flow.py
Co-Authored-By: Paulus Schoutsen <balloob@gmail.com>
* Remove configurator dependency
* Strip whitespace from device model in case Spotify product is missing
* Ensure domain dict exists in hass data on setup entry
* Simply config validation for client id and secret
* Abort flow on any exception from spotipy
* Add tests for config flow
* Gen requirements all
* Add test package __init__
* Remove Spotify from coveragerc
* Made alias handling more robuust
* Fix supported_features for Spotify free and open accounts
* Improve error message in the logs
* Re-implement Spotify media_player
* Change media content type when play a playlist
* Process review suggestions
* Move Spotify init, static current user and supported_features
* Remove unneeded me call
* Remove playlist content type due to frontend issues
* Improve playlist handling, when context is missing
* Handle entity disabled correctly
* Handle being offline/unavailable correctly
* Bump Spotipy to 2.7.1
* Update coverage RC, mark integration silver
* Remove URI limitation, lib supports all Spotify URI's now
* Final cleanup
* Addresses Pylint error
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* upgrade to aiopylgtv 0.3.0 and corresponding simplification and cleanup of webostv state tracking
* properly handle case where Live TV is not reported in list of apps
* fix tests (entity state is no longer linked to source id)
* fix pylint checks
* avoid unnecessary retrieval of channel list
* use only standard home assistant states
* add missing tests
* readd removed test
* add zeroconf discovery support for vizio integration
* no mock_coro_func needed
* add reasonable timeout and don't log exceptions from pyvizio due to timeout
* add test to test options update and bump pyvizio to avoid timeout issues
* update requirements_*
* fix gaps in coverage
* change return hint for async_setup_entry
* use source variables instead of strings
* only get unique ID if about to create entry
* update based on review
* Revert "update based on review"
This reverts commit 0d612a90eb7d02c92061f902973e527267e3110a.
* f-string
* fix last review
* revert cleanup changes to simplify PR
* remove unnecessary ConfigFlow object variables to simplify logic
* revert cleanup changes to make review easier, noted for future cleanup
* revert cleanup changes to make review easier, noted for future cleanup
* move zeroconf service type constant to test module
* add config flow support, device registry support, available property
* raise PlatformNotReady if HA cant connect to device
* remove test logging statement and fix integration title
* store import and last user input values so user can see errors next to value that caused error
* add PARALLEL_UPDATES
* add missing type hints
* add missing type hints to tests
* fix options config flow title
* changes based on review
* better key name for message when cant connect
* fix missed update to key name
* fix comments
* remove logger from test which was used to debug and update test function names and docstrings to be more accurate
* add __init__.py to vizio tests module
* readded options flow and updated main component to handle options updates, set unique ID to serial, fixes based on review
* pop hass.data in media_player unload instead of in __init__ since it is set in media_player
* update requirements_all and requirements_test_all
* make unique_id key name a constant
* remove additional line breaks after docstrings
* unload entries during test_user_flow and test_import_flow tests to hopefully reduce teardown time
* try to speed up tests
* remove unnecessary code, use event bus to track options updates, move patches to pytest fixtures and fix patch scoping
* fix comment
* remove translations from commit
* suppress API error logging when checking for device availability as it can spam logs
* update requirements_all and requirements_test_all
* dont pass hass to entity since it is passed to entity anyway, remove entity unload from tests, other misc changes from review
* fix clearing listeners
* use config_entry unique ID for unique ID and use config_entry entry ID as update signal
* update config flow based on suggested changes
* update volume step on config import if it doesn't match config_entry volume step
* update config_entry data and options with new volume step value
* copy entry.data and entry.options before updating when updating config_entry
* fix test_import_entity_already_configured
* Refactor to use ids in data class
* Use station_id
* Refactor Netatmo to use oauth
* Remove old code
* Clean up
* Clean up
* Clean up
* Refactor binary sensor
* Add initial light implementation
* Add discovery
* Add set schedule service back in
* Add discovery via homekit
* More work on the light
* Fix set schedule service
* Clean up
* Remove unnecessary code
* Add support for multiple entities/accounts
* Fix MANUFACTURER typo
* Remove multiline inline if statement
* Only add tags when camera type is welcome
* Remove on/off as it's currently broken
* Fix camera turn_on/off
* Fix debug message
* Refactor some camera code
* Refactor camera methods
* Remove old code
* Rename method
* Update persons regularly
* Remove unused code
* Refactor method
* Fix isort
* Add english strings
* Catch NoDevice exception
* Fix unique id and only add sensors for tags if present
* Address comments
* Remove ToDo comment
* Add set_light_auto back in
* Add debug info
* Fix multiple camera issue
* Move camera light service to camera
* Only allow camera entities
* Make test pass
* Upgrade pyatmo module to 3.2.0
* Update requirements
* Remove list comprehension
* Remove guideline violating code
* Remove stale code
* Rename devices to entities
* Remove light platform
* Remove commented code
* Exclude files from coverage
* Remove unused code
* Fix unique id
* Address comments
* Fix comments
* Exclude sensor as well
* Add another test
* Use core interfaces
* Add tests
* Add FileSync test
* Fill in services.yaml for 'androidtv.adb_filesync' service
* Update example paths in services.yaml
* Bump androidtv to 0.0.37
* Bump androidtv to 0.0.37
* Bump androidtv to 0.0.37
* Import LockNotAcquiredException
* Import LockNotAcquiredException from androidtv.exceptions
* Rename 'host' to 'address'
* Add a logging statement when an ADB command is skipped
* Check hass.config.is_allowed_path(local_path)
* Add return
* Fix pylint
* Reduce duplicated code (AndroidTVDevice vs. FireTVDevice)
* Split 'adb_filesync' service into 'download' and 'upload' services
* Don't use '.get()' for required data; return if the services are already registered
* Replace "command" with ATTR_COMMAND
* Don't try to connect to a device if it is a duplicate
* Add LED control
* Bump python-velbus library to 2.0.35
To have LED control available in library
* Apply black formating
* Fix no-else-return pylint error
* Changed to f-string and more dry code
* Rewrite turn_on for LED control
* Preserve new BLE device name if one seen before the last scan but not on it
* Save an indented else block
* Use async_fire_time_changed and mock_device_tracker_conf in tests
* add KEF speakers platform for the integration
This will work with the KEF LS50 Wireless and KEF LSX speakers.
The development of this code happened on https://github.com/basnijholt/media_player.kef
* rename DATA_KEF -> DOMAIN
* use aiokef v0.2.0 and support LSX and new features
* sort imports
* fix @MartinHjelmare's suggestions
* remove _CONFIGURING
* change STATE_UNKNOWN to None
* use lat and long for unique_id
* bump aiokef to v0.2.2
* use config[ATTR] instead of config.get(ATTR)
* use getmac
* fix case when MAC is None
* use host as instance lifetime id
* fix requirements
* Use config entry unique id
* Clean up
* Backwards compatiblity note
* Fix some of Balloobs comments
* Bump dependency to v66
* Black somehow missed config flow tests...
* Move set unique ID til after possibility to update existing entry
* Add generic command functionality to denonavr
* add minimal unit tests for denonavr
* fix import order
* simplify denonavr unit test
* handle domain specific service calls with dispatcher
* update unit tests
* update unit tests
* remove unnecessary return value
* fix handling of mock instances in unit tests
* migrate webostv to new aiopylgtv version of the library and add support
for generic commands, input/button commands, and callback state updates
* update requirements
* cleanup and bump aiopylgtv version
* update webostv unit tests
* make webostv unit tests work with python 3.7
* cleanup for code checks
* cleanup and code review
* make all client request functions coroutines
* make host required for webostv configuration
* remove generic command and button functionality plus related cleanup
* fix previous track function
* update unit tests
* fix imports for unit tests
* update unit test
* further unit test updates
* remove unnecessary setup call in unit tests
* restore previous behaviour with client key config file in hass configuration directory
* Bump adb-shell to 0.1.0 and androidtv to 0.0.36
* Add test for setting up two devices
* Add test_setup_same_device_twice
* Fix test_setup_two_devices
* Fix coverage
* Coverage
* Fix flaky 'test_setup_two_devices'
* Another stab at coverage
* Rename 'address' back to 'host'
* iCloud: setup ConfigFlow and prepare for more platforms
- add config flow + tests
- fix existing services
- add play_sound & display_message services
- document services
- can use devices with the same name
- prepare to add sensor platform
* Review : not copy account conf
* Review: Safer test patch
* Review: remove reset_account
* Review: Use executor_job while IO
* Review: Use executor_job while IO 2
* Review: use hass.helpers.storage.Store()
* Review: no IO in tests
* Remove reset from services.yaml
* Review: remove authenticate.return_value = Mock()
* Review: do not initialize the api with the mocked service
* isort
* Review: @MartinHjelmare Test config flow with all steps
* Review: Fix failed tests names
* Codevov: Add one missing test
* Adding tests for vera component.
Fixing update bug in the vera climate platform.
* Updating requrements file.
* Moving vera stop to a job.
Sorting imports.
* Addressing simple PR feedback.
* Splitting tests into platforms.
* Mocking controller instead of using requests_mock.
* Updating pyvera to use version that stops threads quickly.
* Updating requirements files.
* Mocking the pyvera module, not the API.
* Addressing PR feedback.
Handling start/stop of patch in fixture.
Removing unecessary code.
* Using generator
* Add Elgato Key Light integration
* Remove passing in of hass loop
* Tweaks a comment
* Tweaks a function name
* Ensure domain namespace in data exists in entry setup
* Only create cloud user if cloud in use
* Pass context to alexa
* Update requirements
* Fix handing & design pattern for 0.30
* fix tests
* Fix lint & tests
* rename internal user
* first version of new integration
* moved icon to shared consts
* added unit tests
* transformed from geolocation to sensor integration
* alert level is now the state of the sensor
* adopted unit tests
* fixed comment
* keep all sensors registered even if the feed update fails intermittently
* bumped version of upstream library
* bumped version of integration library
* regenerated requirements
* bumped version of integration library
* bumped version of integration library
* fixed generated file
* removed commented out code
* regenerated config flow file
* update to latest integration library version
* simplified code
* removed debug log statement
* simplified code structure
* defined constant
* use core interfaces
* moved test and fixture
* sorted imports
* simplified patching
* moved fixture to central config file
* Add bandit to pre-commit and CI, use to catch known vulnerable XML parsing
* Use defusedxml instead of direct xml.etree to parse XML
* Move config to tests/bandit.yaml
* First commit
* First working release, but there's a lot to do
* Added support for preset_modes
* Refined logic
* Added translations for config_flow
* Updated translations
* modified: homeassistant/components/hisense_aehw4a1/climate.py
* modified: climate.py
* Updated library to latest version
* Small changes
* Null states when AC off
* Minor fixes
* Latest updates for TOX
* First commit
* First working release, but there's a lot to do
* new file: requirements_test_all.txt
* Added support for preset_modes
* Refined logic
* Added translations for config_flow
* Updated translations
* modified: homeassistant/components/hisense_aehw4a1/climate.py
* modified: climate.py
* Updated library to latest version
* Small changes
* Null states when AC off
* Minor fixes
* Latest updates for TOX
* new file: requirements_test_all.txt
* Fighting with tox
* vs Tox round 2
* Isort and updated requirements_test_all.txt
* Fighting with lint
* Implemented available state
* Changed exception type after Travis-ci pylint fails
* Support entry in configuration.yaml
* Removed commented code
* Switched to async
* Minor changes
* Updated library and fixed pylint errors
* Code optimization
* Implemented static ip addresses in configuration.yaml
* Reverted to existing constant
* Corrected pylint wrong-import-order
* Recovery from nuke event (messing all while rebase)
* Resolved Ci error
* Changes for PR
* Corrected temp scale for frontend
* Added test for config entry from configuration.yaml
* Updated dependency
* Check on manual config
* Imported custom exceptions and modified import config
* Optimized
* Change based on PR revision
* Added logging for failure event on manual config
* Tests added but to be corrected
* Edited tests
* Tests updated to ensure no I/O
* Working on tests
* Cheanges based on revision for PR
* Setting librey exception as direct side_effect in test
* Final changes for PR
* Redundand on command solved
* Improved AC logic
* Start
* Lock init
* More stubbing
* Final pieces for PR
* Fixed incorrect property access
* Updaed .coveragerc
* Ensure we can handle unknown states
* Account for lock's offline property
* Account for device online
* Unload components concurrently
* Handle unknown states more gracefully
* Add WLED integration
* Use f-string for uniq id in sensor platform
* Typing improvements
* Removes sensor & light platform
* Remove PARALLEL_UPDATES from integration level
* Correct type in code comment 'themselves'
* Use async_track_time_interval in async context
* Remove stale code
* Remove decorator from Flow handler
* Remove unused __init__ from config flow
* Move show form methods to sync
* Only wrap lines that can raise in try except block
* Remove domain and platform from uniq id
* Wrap light state in bool object in is_on method
* Use async_schedule_update_ha_state in async context
* Return empty dict in device state attributes instead of None
* Remove unneeded setdefault call in setup entry
* Cancel update timer on entry unload
* Restructure config flow code
* Adjust tests for new uniq id
* Correct typo AdGuard Home -> WLED in config flow file comment
* Convert internal package imports to be relative
* Reformat JSON files with Prettier
* Improve tests based on review comments
* Add test for zeroconf when no data is provided
* Cleanup and extended tests
* Save client identifier from auth for future use
* Use websocket events to update Plex
* Handle websocket disconnections
* Use aiohttp, shut down socket cleanly
* Bad rebase fix
* Don't connect websocket during config_flow validation, fix tests
* Move websocket handling to external library
* Close websocket session on HA stop
* Use external library, revert unnecessary test change
* Async & lint fixes
* Clean up websocket stopper on entry unload
* Setup websocket in component, pass actual needed object to library
* Using latest winthings_api module.
Drastically reduced complexity of tests.
* Removing import source.
* Fixing test requirements.
* Using requests_mock instead of responses module.
* Updating file formatting.
* Removing unused method.
* Adding support for new OAuth2 config flow.
* Addressing PR feedback.
Removing unecessary base_url from config, this is a potential breaking change.
* Addressing PR feedback.
* Modernization rework
- config entry support, with override support from huawei_lte platform in YAML
- device tracker entity registry support
- refactor for easier addition of more features
- internal code cleanups
* Remove log level dependent subscription/data debug hack
No longer needed, because pretty much all keys from supported
categories are exposed as sensors.
Closes https://github.com/home-assistant/home-assistant/issues/23819
* Upgrade huawei-lte-api to 1.4.1
https://github.com/Salamek/huawei-lte-api/releases
* Add support for access without username and password
* Use subclass init instead of config_entries.HANDLERS
* Update huawei-lte-api to 1.4.3 (#27269)
* Convert device state attributes to snake_case
* Simplify scanner entity initialization
* Remove not needed hass reference from Router
* Return explicit None from unsupported old device tracker setup
* Mark unknown connection errors during config as such
* Drop some dead config flow code
* Run config flow sync I/O in executor
* Parametrize config flow login error tests
* Forward entry unload to platforms
* Async/sync fixups
* Improve data subscription debug logging
* Implement on the fly add of new and tracking of seen device tracker entities
* Handle device tracker entry unload cleanup in component
* Remove unnecessary _async_setup_lte, just have code in async_setup_entry
* Remove time tracker on unload
* Fix to not use same mutable default subscription set for all routers
* Pylint fixes
* Remove some redundant defensive device tracker code
* Add back explicit get_scanner None return, hush pylint
* Adjust approach to set system_options on entry create
* Enable some sensors on first add instead of disabling everything
* Fix SMS notification recipients default value
* Add option to skip new device tracker entities
* Fix SMS notification recipient option default
* Work around https://github.com/PyCQA/pylint/issues/3202
* Remove unrelated type hint additions
* Change async_add_new_entities to a regular function
* Remove option to disable polling for new device tracker entries
* Config entry and device for Coolmaster integration
* Lint/isort/flake/etc...
* Black formatting
* Code review fixes
* Config flow tests for coolmaster
* Add pycoolmaster requirement to test
* Remove port selection from Coolmaster config flow
* Update config_flow.py
* More idoimatic hash concat
* Remove tplink device tracker
Version 0.94 added a distress signal and since then nothing has happened.
This commit removes the device tracker which should have never been
a part of tplink integration in the first place as it does not share
anything with this pyhs100-based integration / kasa smarthome.
* add updated requirements_test_all that was forgotten
* remove unit tests
* Bump adguardhome to 0.3.0
* Add a more user friendly version handling and added logs
* ✏️ Fixes spelling error in abort messages
* ✏️ Error messages improvements, suggested by cgtobi
* Refactor the Somfy auth implementation
* Typing
* Migrate Somfy to OAuth2 flow helper
* Add tests
* Add more tests
* Fix tests
* Fix type error
* More tests
* Remove side effect from constructor
* implementation -> auth_implementation
* Make get_implementation async
* Minor cleanup + Allow picking implementations.
* Add support for extra authorize data
* Added apprise notification component
* flake-8 fixes; black formatting + import merged to 1 line
* pylint issues resolved
* added github name to manifest.json
* import moved to top as per code review request
* manifest formatting to avoid failing ci
* .coveragerc updated to include apprise
* removed block for written tests
* more test coverage
* formatting as per code review
* tests converted to async style as per code review
* increased coverage
* bumped version of apprise to 0.8.1
* test that mocked entries are called
* added tests for hass.service loading
* support tags for those who identify the TARGET option
* renamed variable as per code review
* 'assert not' used instead of 'is False'
* added period (in case linter isn't happy)
* Adds support for config entries and device registry
* Fixing string formatting for logger
* Add unit test for abode config flow
* Fix for lights, only allow one config, add ability to unload entry
* Fix for subscribing to hass_events on adding abode component
* Several fixes from code review
* Several fixes from second code review
* Several fixes from third code review
* Update documentation url to fix branch conflict
* Fixes config flow and removes unused constants
* Fix for switches, polling entry option, improved tests
* Update .coveragerc, disable pylint W0611, remove polling from UI
* Multiple fixes and edits to adhere to style guidelines
* Removed unique_id
* Minor correction for formatting error in rebase
* Resolves issue causing CI to fail
* Bump abodepy version
* Add remove device callback and minor clean up
* Fix incorrect method name
* Docstring edits
* Fix duplicate import issues from rebase
* Add logout_listener attribute to AbodeSystem
* Add additional test for complete coverage
* Fixing connection issues with withings API by switching to a maintained client codebase.
* Updating requirements files.
* Adding withings api to requirements script.
* Using version of withings api with static version in setup.py.
* Updating requirements files.
* Install requirements for all deps with tests
* Remove unused REQUIREMENTS var
* Print diff if not the same
* Simplify
* Update command line
* Fix detecting empty dirs
* Install non-integration
* Fix upnp tests
* Lint
* Fix ZHA test
* Fixing connection issues with withings API by switching to a maintained client codebase.
* Updating requirements files.
* Adding withings api to requirements script.
* initial commit
* Minor changes
* add async setup entry
* Add translations and some other stuff
* add and remove entry
* use async_setup_entry
* Update config_flows.py
* dshokouhi's changes
* Improve workflow
* Add valid_vendors
* Add entity registry
* Add device registry
* Update entry from configuration.yaml
* Revert unneccesary changes
* Update .coveragerc
* Prepared tests
* Add dshokouhi and Santobert as codeowners
* Fix unload entry and abort when already_configured
* First tests
* Add test for abort cases
* Add test for invalid credentials on import
* Add one last test
* Add test_init.py with some tests
* Address reviews, part 1
* Update outdated entry
* await instead of add_job
* run IO inside an executor
* remove faulty test
* Fix pylint issues
* Move IO out of constructur
* Edit error translations
* Edit imports
* Minor changes
* Remove test for invalid vendor
* Async setup platform
* Edit login function
* Moved IO out if init
* Update switches after added to hass
* Revert update outdated entry
* try and update new entrys from config.yaml
* Add test invalid vendor
* Default to neato
* Add config flow support to opentherm_gw.
Bump pyotgw to 0.5b0 (required for connection testing)
Existing entries in configuration.yaml will be converted to config entries and ignored in future runs.
* Fix not connecting to Gateway on startup.
Pylint fixes.
* Add tests for config flow.
Remove non-essential options from config flow.
Restructure config entry data.
* Make sure gw_id is slugified