generated from ludeeus/integration_blueprint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor integration_blueprint to belgiantrain: update constants, dat…
…a models, and entity classes
- Loading branch information
Showing
13 changed files
with
168 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
"""Constants for the SNCB/NMBS integration.""" | ||
|
||
from logging import Logger, getLogger | ||
|
||
LOGGER: Logger = getLogger(__package__) | ||
|
||
DOMAIN = "belgiantrain" | ||
ATTRIBUTION = "Data provided by http://jsonplaceholder.typicode.com/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Custom types for belgiantrain.""" | ||
|
||
from __future__ import annotations | ||
|
||
from dataclasses import dataclass | ||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from homeassistant.config_entries import ConfigEntry | ||
from homeassistant.loader import Integration | ||
|
||
from . import BelgiantrainApiClient | ||
from .coordinator import BelgiantrainDataUpdateCoordinator | ||
|
||
|
||
# TODO Create ConfigEntry type alias with API object | ||
# TODO Rename type alias and update all entry annotations | ||
type BelgiantrainConfigEntry = ConfigEntry[BelgiantrainData] | ||
|
||
|
||
@dataclass | ||
class BelgiantrainData: | ||
"""Data for the belgiantrain integration.""" | ||
|
||
client: BelgiantrainApiClient | ||
coordinator: BelgiantrainDataUpdateCoordinator | ||
integration: Integration |
10 changes: 5 additions & 5 deletions
10
...omponents/integration_blueprint/entity.py → custom_components/belgiantrain/entity.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.