Skip to content

Commit

Permalink
add is_available property to node
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Hoch committed Dec 19, 2023
1 parent a986977 commit e1547ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pyvlx/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ async def rename(self, name: str) -> None:
raise PyVLXException("Unable to rename node")
self.name = name

@property
def is_available(self) -> bool:
return self.pyvlx.is_connected()

def __str__(self) -> str:
"""Return object as readable string."""
return (
Expand Down
2 changes: 1 addition & 1 deletion pyvlx/pyvlx.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ async def reboot_gateway(self) -> None:
await self.klf200.reboot()

def is_connected(self) -> bool:
"""Returns whether or not the gateway is currently connected."""
"""Returns whether the gateway is currently connected."""
return self.connection.connected

async def check_connected(self) -> None:
Expand Down

0 comments on commit e1547ea

Please sign in to comment.