Skip to content

Commit

Permalink
add online property
Browse files Browse the repository at this point in the history
  • Loading branch information
arska committed Dec 13, 2023
1 parent 5cef794 commit 9d3239a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions controlmyspa.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,10 @@ def get_serial(self):
Get spa serial number
"""
return self._info["serialNumber"]

@property
def online(self):
"""
Get the spa online status
"""
return self._info["online"]
2 changes: 2 additions & 0 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

API = ControlMySpa(ARGS.email, ARGS.password)

print("online", API.online)

print("current temp", API.current_temp)
print("desired temp", API.desired_temp)

Expand Down
5 changes: 5 additions & 0 deletions tests/test_controlmyspa.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,11 @@ def test_ozone_generators_empty(self):
]
self.assertEqual(cms.ozone_generators, [])

def test_online(self):
cms = ControlMySpa(self.exampleusername, self.examplepassword)
# in the example dataset the spa is online
self.assertEqual(cms.online, True)


if __name__ == "__main__":
unittest.main()

0 comments on commit 9d3239a

Please sign in to comment.