Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HA 2024.1 deprecated constants replacement #112

Merged
merged 4 commits into from
Feb 11, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Replaced deprecated SOURCE_TYPE_ROUTER with SourceType.ROUTER in devi…
…ce_tracker
  • Loading branch information
alexdelprete committed Jan 31, 2024
commit 26c0ee4a0c1f7267a78b9dda00e3bc6e912a888f
4 changes: 2 additions & 2 deletions custom_components/opnsense/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import time
from typing import Any, Mapping

from homeassistant.components.device_tracker import SOURCE_TYPE_ROUTER
from homeassistant.components.device_tracker import SourceType.ROUTER
from homeassistant.components.device_tracker.config_entry import ScannerEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
Expand Down Expand Up @@ -190,7 +190,7 @@ def available(self) -> bool:
@property
def source_type(self) -> str:
"""Return the source type, eg gps or router, of the device."""
return SOURCE_TYPE_ROUTER
return SourceType.ROUTER

@property
def extra_state_attributes(self) -> Mapping[str, Any] | None:
Expand Down
Loading