* Remove malformed pylint disable markers
* Remove some unused imports
* Remove some unneeded lint exclusions
* Remove more unneeded lint exclusions
* Add specific codes to all noqa's
* Change datetime.now() to dt_util.now() in cases where the functionality should stay the same
These changes should not affect the functionality, rather cleanup our codebase.
In general we would like integrations to not to use datetime.now() unless there's a very good
reason for it, rather use our own dt_util.now() which makes the code aware of our current time
zone.
* Use datetime.utcnow() for season sensor to get offset-naive utc time
* Revert "Use datetime.utcnow() for season sensor to get offset-naive utc time"
This reverts commit 5f36463d9c7d52f8e11ffcec7e57dfbc7b21bdd1.
* BOM sensor last_updated should be UTC as well
* Run black
* Remove unused last_partition_update variable
* initial implementation for zha device trackers
* constant
* review comments
* Revert "review comments"
This reverts commit 2130823566820dfc114dbeda08fcdf76ed47a4e7.
* rename device tracker entity
* update trackers
* raise when not implemented
* Update homeassistant/components/device_tracker/config_entry.py
Review comment
Co-Authored-By: Martin Hjelmare <marhje52@kth.se>
* move source type to base state attrs
* review comments
* review comments
* review comments
* fix super call
* fix battery and use last seen from device
* add test
* cleanup and add more to test
* cleanup post zha entity removal PR
* add tests for base entities
* rework entity tests
Loading a component defined in a registration didn't actually work and was undocumented, so let's just remove it instead of fixing #23005.
## Checklist:
- [X] The code change is tested and works locally.
- [X] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
- [X] There is no commented out code in this PR.
* Ensure we only add a sensor once
* Ensure that we dont process updates for entities that arent what we were setup for
* Add debug logging to ease development of apps
* Use str representation
* Add mobile_app notify platform
* Requested changes
* Fix incorrect param for status code
* Move push_registrations to notify platform file
* Trim down registration information sent in push
* quotes
* Use async version of load_platform
* Add warning for duplicate device names
* Switch to async_get_service
* add mobile_app.notify test
* Update tests/components/mobile_app/test_notify.py
* Update tests/components/mobile_app/test_notify.py
## Description:
Adds a new `mobile_app` webhook command, `get_zones`, which just returns all zones.
## Checklist:
- [x] The code change is tested and works locally.
- [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
- [x] There is no commented out code in this PR.
## Description:
**Related issue (if applicable):** fixes#21782
## Checklist:
- [x] The code change is tested and works locally.
- [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
- [x] There is no commented out code in this PR.
* Register devices into the registry
* Switch to device ID instead of webhook ID
* Rearchitect mobile_app to support config entries
* Kill DATA_REGISTRATIONS by migrating registrations into config entries
* Fix tests
* Improve how we get the config_entry_id
* Remove single_instance_allowed
* Simplify setup_registration
* Move webhook registering functions into __init__.py since they are only ever used once
* Kill get_registration websocket command
* Support description_placeholders in async_abort
* Add link to mobile_app implementing apps in abort dialog
* Store config entry and device registry entry in hass.data instead of looking it up
* Add testing to ensure that the config entry is created at registration
* Fix busted async_abort test
* Remove unnecessary check for entry is None
* Update location schema
* Generate a random device ID at registration time for later use with device_tracker.see
* Remove host name from device_tracker.see payload
* Drop consider_home from the payload
* Remove stale consider_home in schema
* Remove source_type
## Description:
**Related issue (if applicable):** fixes#21758
## Checklist:
- [x] The code change is tested and works locally.
- [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
- [x] There is no commented out code in this PR.
* Update registration schema to add os_name (required) and make app_name required
* Ensure that a provided app_component is valid and available
* Ensure that component DEPENDENCIES declares mobile_app
* Update homeassistant/helpers/config_validation.py
* Standardize error responses
* Dont generalize REGISTER_BAD_COMPONENT
* Fix tests after merge
* First webhook commands for getting and deleting single registrations
* Keep a list of deleted webhook IDs so we can 410 if the webhook receives traffic in the future
* Return a empty JSON object instead of None
* Split up mobile_app bits into individual files
* Add typing
* Sort keys
* Remove unused async_setup_entry
* New decorator method of registering webhooks
* Add tests for cloud hook forwarding and improve error handling for cloud hooks
* Initial implementation of platform specific logic
* Add get registrations by user ID websocket call, minor style fixes
* Stop using resp dictionary during registration
* Move mobile_app/ios.py to ios/mobile_app.py
* Log any errors encountered during webhook
* Improve update registration call
* Split up mobile_app tests to match split up component
* Fix tests
* Remove integration_map in favor of component name in registration
* Add a few helper functions for custom logic components to use
* Load the app_component platform at device registration or component setup time
* Remove extraneous function
* Use guard function for checking if component is in device
* Inline websocket schemas
* Rename ATTR_s used in storage to DATA_ prefix
* squash flake8 and pylint issues
* Remove ios.mobile_app platform
* Dont mark websocket_api as a dependency
* Return standard empty_okay_response with 400 if no JSON sent
* Ensure deleted webhook IDs are registered at launch
* Remove the creation of cloudhooks during handle_webhook
* Rename device to registration everywhere applicable
* Dont check if cloud is logged in, just check if cloud is in components
* Dont ever use cloudhook_id
* Remove component loading logic for a later PR
* Cast exception to string
* Remove unused functions
* Initial pass of a mobile_app component
* Fully support encryption, validation for the webhook payloads, and other general improvements
* Return same format as original API calls
* Minor encryption fixes, logging improvements
* Migrate Owntracks to use the superior PyNaCl instead of libnacl, mark it as a requirement in mobile_app
* Add mobile_app to .coveragerc
* Dont manually b64decode on OT
* Initial requested changes
* Round two of fixes
* Initial mobile_app tests
* Dont allow making registration requests for same/existing device
* Test formatting fixes
* Add mobile_app to default_config
* Add some more keys allowed in registration payloads
* Add support for getting a single device, updating a device, getting all devices. Also change from /api/mobile_app/register to /api/mobile_app/devices
* Change device_id to fingerprint
* Next round of changes
* Add keyword args and pass context on all relevant calls
* Remove SingleDeviceView in favor of webhook type to update registration
* Only allow some properties to be updated on registrations, rename integration_data to app_data
* Add call service test, ensure events actually fire, only run the encryption tests if sodium is installed
* pylint
* Fix OwnTracks test
* Fix iteration of devices and remove device_for_webhook_id