Skip to content

Commit

Permalink
Remove deprecated EventType, bump HA version, update python version
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Apr 25, 2024
1 parent abfceef commit 459f6bf
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/integration/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BN Integration",
"image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.11-bullseye",
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.12-bullseye",
"postCreateCommand": "scripts/setup",
"runArgs": [
"--network=host"
Expand Down
5 changes: 2 additions & 3 deletions custom_components/battery_notes/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
async_track_entity_registry_updated_event,
)
from homeassistant.helpers.reload import async_setup_reload_service
from homeassistant.helpers.typing import EventType

from homeassistant.const import (
CONF_NAME,
Expand Down Expand Up @@ -242,7 +241,7 @@ def _default_update(self, result: str | TemplateError) -> None:
@callback
def handle_result(
self,
event: EventType[EventStateChangedData] | None,
event: Event[EventStateChangedData] | None,
template: Template,
last_result: str | None | TemplateError,
result: str | TemplateError,
Expand Down Expand Up @@ -423,7 +422,7 @@ def _async_template_startup(
@callback
def _handle_results(
self,
event: EventType[EventStateChangedData] | None,
event: Event[EventStateChangedData] | None,
updates: list[TrackTemplateResult],
) -> None:
"""Call back the results to the attributes."""
Expand Down
5 changes: 2 additions & 3 deletions custom_components/battery_notes/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
CoordinatorEntity,
)
from homeassistant.helpers.reload import async_setup_reload_service
from homeassistant.helpers.typing import EventType

from homeassistant.helpers.entity_registry import (
EVENT_ENTITY_REGISTRY_UPDATED,
Expand Down Expand Up @@ -310,7 +309,7 @@ def __init__(

@callback
async def async_state_changed_listener(
self, event: EventType[EventStateChangedData] | None = None
self, event: Event[EventStateChangedData] | None = None
) -> None:
# pylint: disable=unused-argument
"""Handle child updates."""
Expand Down Expand Up @@ -410,7 +409,7 @@ async def async_added_to_hass(self) -> None:

@callback
async def _async_state_changed_listener(
event: EventType[EventStateChangedData] | None = None,
event: Event[EventStateChangedData] | None = None,
) -> None:
"""Handle child updates."""
await self.async_state_changed_listener(event)
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Battery Notes",
"filename": "battery_notes.zip",
"hide_default_branch": true,
"homeassistant": "2023.11.0",
"homeassistant": "2024.1.0",
"render_readme": true,
"zip_release": true,
"persistent_directory": "data"
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
colorlog>=6.8.2,<7.0
homeassistant>=2023.11.0
homeassistant>=2024.1.0
ruff>=0.3.2,<0.5

0 comments on commit 459f6bf

Please sign in to comment.