mobile_app improvements (#21607)
* 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
This commit is contained in:
1 parent
49eaa34e03
commit
9ab0753cf7
12 files changed
+1022
-613
No files matched your search
@@ -0,0 +1,49 @@
|
||||
"""Constants for mobile_app tests."""
|
||||
CALL_SERVICE = {
|
||||
'type': 'call_service',
|
||||
'data': {
|
||||
'domain': 'test',
|
||||
'service': 'mobile_app',
|
||||
'service_data': {
|
||||
'foo': 'bar'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FIRE_EVENT = {
|
||||
'type': 'fire_event',
|
||||
'data': {
|
||||
'event_type': 'test_event',
|
||||
'event_data': {
|
||||
'hello': 'yo world'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
REGISTER = {
|
||||
'app_data': {'foo': 'bar'},
|
||||
'app_id': 'io.homeassistant.mobile_app_test',
|
||||
'app_name': 'Mobile App Tests',
|
||||
'app_version': '1.0.0',
|
||||
'device_name': 'Test 1',
|
||||
'manufacturer': 'mobile_app',
|
||||
'model': 'Test',
|
||||
'os_version': '1.0',
|
||||
'supports_encryption': True
|
||||
}
|
||||
|
||||
RENDER_TEMPLATE = {
|
||||
'type': 'render_template',
|
||||
'data': {
|
||||
'template': 'Hello world'
|
||||
}
|
||||
}
|
||||
|
||||
UPDATE = {
|
||||
'app_data': {'foo': 'bar'},
|
||||
'app_version': '2.0.0',
|
||||
'device_name': 'Test 1',
|
||||
'manufacturer': 'mobile_app',
|
||||
'model': 'Test',
|
||||
'os_version': '1.0'
|
||||
}
|
||||
Reference in new issue
Block a user