Skip to content

Commit

Permalink
fix: is_connected property (#368)
Browse files Browse the repository at this point in the history
* Bug fix: self.transport shall not be None!

* Simplify condition

Co-authored-by: Bander <[email protected]>

---------

Co-authored-by: Bander <[email protected]>
  • Loading branch information
Lurker00 and xZetsubou authored Oct 17, 2024
1 parent 5c90780 commit 618139f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/localtuya/core/pytuya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ def enable_debug(self, enable=False, friendly_name=None):

@property
def is_connected(self):
return not self.transport or not self.transport.is_closing()
return self.transport and not self.transport.is_closing()

@property
def last_command_sent(self):
Expand Down

0 comments on commit 618139f

Please sign in to comment.