forked from sfstar/hass-victron
-
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.
from PR sfstar#264: ruff format and ruff check --fix and some mypy/py…
…lint erros and fix PR sfstar#264 and fix issues sfstar#259, sfstar#261
- Loading branch information
Showing
14 changed files
with
2,601 additions
and
1,063 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
custom_components/victron/__pycache__ | ||
.DS_Store |
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,14 +1,20 @@ | ||
from collections.abc import Callable | ||
from homeassistant.helpers.typing import StateType | ||
|
||
from dataclasses import dataclass | ||
|
||
from homeassistant.helpers.entity import EntityDescription | ||
from homeassistant.helpers.typing import StateType | ||
|
||
|
||
@dataclass | ||
class VictronBaseEntityDescription(EntityDescription): | ||
slave: int = None | ||
value_fn: Callable[[dict], StateType] = lambda data, slave, key: data["data"][str(slave) + "." + str(key)] | ||
@staticmethod | ||
def lambda_func(): | ||
return lambda data, slave, key: data["data"][str(slave) + "." + str(key)] | ||
|
||
slave: int = None | ||
value_fn: Callable[[dict], StateType] = lambda_func() | ||
|
||
@dataclass | ||
|
||
@dataclass | ||
class VictronWriteBaseEntityDescription(VictronBaseEntityDescription): | ||
address: int = None | ||
address: int = None |
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
Oops, something went wrong.