Skip to content

Commit

Permalink
Add API to fetch flat boiler status
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgospodinow committed Aug 28, 2024
1 parent 4b1a3ca commit 6749e0e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions eldom/flat_boiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ def __init__(self, base_url, timeout=30):

super().__init__(base_url, timeout)

def get_flat_boiler_status(self, device_id):
"""
Get the status of a flat boiler device.
:param device_id: The device ID.
:return: The response from the server.
"""
url = f"{self.base_url}/api/flatboiler/{device_id}"
response = self.session.get(url)
response.raise_for_status()
return response.json().get("objectJson")

def set_flat_boiler_state(self, device_id, state):
"""
Set the state of a flat boiler device.
Expand Down

0 comments on commit 6749e0e

Please sign in to comment.