mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Include hass device ID in mobile app get_config webhook (#121496)
This commit is contained in:
parent
00aafc0cf7
commit
1aa9588dcb
@ -721,10 +721,15 @@ async def webhook_get_config(
|
|||||||
"""Handle a get config webhook."""
|
"""Handle a get config webhook."""
|
||||||
hass_config = hass.config.as_dict()
|
hass_config = hass.config.as_dict()
|
||||||
|
|
||||||
|
device: dr.DeviceEntry = hass.data[DOMAIN][DATA_DEVICES][
|
||||||
|
config_entry.data[CONF_WEBHOOK_ID]
|
||||||
|
]
|
||||||
|
|
||||||
resp = {
|
resp = {
|
||||||
"latitude": hass_config["latitude"],
|
"latitude": hass_config["latitude"],
|
||||||
"longitude": hass_config["longitude"],
|
"longitude": hass_config["longitude"],
|
||||||
"elevation": hass_config["elevation"],
|
"elevation": hass_config["elevation"],
|
||||||
|
"hass_device_id": device.id,
|
||||||
"unit_system": hass_config["unit_system"],
|
"unit_system": hass_config["unit_system"],
|
||||||
"location_name": hass_config["location_name"],
|
"location_name": hass_config["location_name"],
|
||||||
"time_zone": hass_config["time_zone"],
|
"time_zone": hass_config["time_zone"],
|
||||||
|
@ -10,7 +10,7 @@ from nacl.secret import SecretBox
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components.camera import CameraEntityFeature
|
from homeassistant.components.camera import CameraEntityFeature
|
||||||
from homeassistant.components.mobile_app.const import CONF_SECRET, DOMAIN
|
from homeassistant.components.mobile_app.const import CONF_SECRET, DATA_DEVICES, DOMAIN
|
||||||
from homeassistant.components.tag import EVENT_TAG_SCANNED
|
from homeassistant.components.tag import EVENT_TAG_SCANNED
|
||||||
from homeassistant.components.zone import DOMAIN as ZONE_DOMAIN
|
from homeassistant.components.zone import DOMAIN as ZONE_DOMAIN
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
@ -243,6 +243,7 @@ async def test_webhook_handle_get_config(
|
|||||||
"""Test that we can get config properly."""
|
"""Test that we can get config properly."""
|
||||||
webhook_id = create_registrations[1]["webhook_id"]
|
webhook_id = create_registrations[1]["webhook_id"]
|
||||||
webhook_url = f"/api/webhook/{webhook_id}"
|
webhook_url = f"/api/webhook/{webhook_id}"
|
||||||
|
device: dr.DeviceEntry = hass.data[DOMAIN][DATA_DEVICES][webhook_id]
|
||||||
|
|
||||||
# Create two entities
|
# Create two entities
|
||||||
for sensor in (
|
for sensor in (
|
||||||
@ -280,6 +281,7 @@ async def test_webhook_handle_get_config(
|
|||||||
"latitude": hass_config["latitude"],
|
"latitude": hass_config["latitude"],
|
||||||
"longitude": hass_config["longitude"],
|
"longitude": hass_config["longitude"],
|
||||||
"elevation": hass_config["elevation"],
|
"elevation": hass_config["elevation"],
|
||||||
|
"hass_device_id": device.id,
|
||||||
"unit_system": hass_config["unit_system"],
|
"unit_system": hass_config["unit_system"],
|
||||||
"location_name": hass_config["location_name"],
|
"location_name": hass_config["location_name"],
|
||||||
"time_zone": hass_config["time_zone"],
|
"time_zone": hass_config["time_zone"],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user