Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions custom_components/hass_agent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
_logger = logging.getLogger(__name__)


def update_device_info(hass: HomeAssistant, entry: ConfigEntry, new_device_info):
async def update_device_info(hass: HomeAssistant, entry: ConfigEntry, new_device_info):
device_registry = dr.async_get(hass)
device_registry.async_get_or_create(
config_entry_id=entry.entry_id,
Expand Down Expand Up @@ -136,12 +136,12 @@ def get_device_info():

sub_state = hass.data[DOMAIN][entry.entry_id]["internal_mqtt"]

def updated(message: ReceiveMessage):
async def updated(message: ReceiveMessage):
payload = json.loads(message.payload)
cached = hass.data[DOMAIN][entry.entry_id]["apis"]
apis = payload["apis"]

update_device_info(hass, entry, payload)
await update_device_info(hass, entry, payload)

if cached != apis:
hass.async_create_task(handle_apis_changed(hass, entry, apis))
Expand Down