Skip to content

Commit 8730766

Browse files
authored
fix: Replace deprecated HomeAssistantType with HomeAssistant (#268)
* use HomeAssistant instead of deprecated HomeAssistantType * fix alphabetical import * use HomeAssistant instead of deprecated HomeAssistantType Fixes #267
1 parent 370d155 commit 8730766

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

custom_components/nodered/discovery.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import asyncio
33
import logging
44

5+
from homeassistant.core import HomeAssistant
56
from homeassistant.helpers.dispatcher import (
67
async_dispatcher_connect,
78
async_dispatcher_send,
89
)
9-
from homeassistant.helpers.typing import HomeAssistantType
1010

1111
from .const import (
1212
CONF_BINARY_SENSOR,
@@ -49,7 +49,7 @@
4949

5050

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

@@ -113,6 +113,6 @@ async def async_device_message_received(msg, connection):
113113
)
114114

115115

116-
def stop_discovery(hass: HomeAssistantType):
116+
def stop_discovery(hass: HomeAssistant):
117117
"""Remove discovery dispatcher."""
118118
hass.data[DOMAIN_DATA][DISCOVERY_DISPATCHED]()

custom_components/nodered/websocket.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
)
5757
from homeassistant.helpers.dispatcher import async_dispatcher_send
5858
from homeassistant.helpers.entity_registry import async_entries_for_device, async_get
59-
from homeassistant.helpers.typing import HomeAssistantType
6059
import voluptuous as vol
6160

6261

@@ -84,7 +83,7 @@
8483
_LOGGER = logging.getLogger(__name__)
8584

8685

87-
def register_websocket_handlers(hass: HomeAssistantType):
86+
def register_websocket_handlers(hass: HomeAssistant):
8887
"""Register the websocket handlers."""
8988

9089
async_register_command(hass, websocket_device_action)

0 commit comments

Comments
 (0)