Skip to content

Commit

Permalink
fix: Replace deprecated HomeAssistantType with HomeAssistant (#268)
Browse files Browse the repository at this point in the history
* use HomeAssistant instead of deprecated HomeAssistantType

* fix alphabetical import

* use HomeAssistant instead of deprecated HomeAssistantType

Fixes #267
  • Loading branch information
RobertD502 authored May 2, 2024
1 parent 370d155 commit 8730766
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions custom_components/nodered/discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import asyncio
import logging

from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.helpers.typing import HomeAssistantType

from .const import (
CONF_BINARY_SENSOR,
Expand Down Expand Up @@ -49,7 +49,7 @@


async def start_discovery(
hass: HomeAssistantType, hass_config, config_entry=None
hass: HomeAssistant, hass_config, config_entry=None
) -> bool:
"""Initialize of Node-RED Discovery."""

Expand Down Expand Up @@ -113,6 +113,6 @@ async def async_device_message_received(msg, connection):
)


def stop_discovery(hass: HomeAssistantType):
def stop_discovery(hass: HomeAssistant):
"""Remove discovery dispatcher."""
hass.data[DOMAIN_DATA][DISCOVERY_DISPATCHED]()
3 changes: 1 addition & 2 deletions custom_components/nodered/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
)
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.entity_registry import async_entries_for_device, async_get
from homeassistant.helpers.typing import HomeAssistantType
import voluptuous as vol


Expand Down Expand Up @@ -84,7 +83,7 @@
_LOGGER = logging.getLogger(__name__)


def register_websocket_handlers(hass: HomeAssistantType):
def register_websocket_handlers(hass: HomeAssistant):
"""Register the websocket handlers."""

async_register_command(hass, websocket_device_action)
Expand Down

0 comments on commit 8730766

Please sign in to comment.