Skip to content

Commit

Permalink
Added get_channel_info for hass diagnostics, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
cereal2nd committed Feb 11, 2022
1 parent e25ad51 commit 7fb6935
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name="velbus-aio",
version="2022.2.3",
version="2022.2.4",
url="https://github.com/Cereal2nd/velbus-aio",
license="MIT",
author="Maikel Punie",
Expand Down
7 changes: 7 additions & 0 deletions velbusaio/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ def __repr__(self):
def __str__(self):
return self.__repr__()

def get_channel_info(self) -> dict[str, Any]:
data = {}
for key, value in self.__dict__.items():
if key not in ["_module", "_writer", "_name_parts", "_on_status_update"]:
data[key.replace("_", "", 1)] = value
return data

async def update(self, data: dict) -> None:
"""
Set the attributes of this channel
Expand Down

0 comments on commit 7fb6935

Please sign in to comment.