Skip to content

Commit

Permalink
Merge pull request #32 from PimDoos/dev
Browse files Browse the repository at this point in the history
Fix incorrect API version and update example script
  • Loading branch information
PimDoos committed Mar 31, 2024
2 parents 89ae2c3 + 89f6af0 commit a452b54
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
18 changes: 14 additions & 4 deletions examples/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
from sessypy.devices import SessyDevice, SessyP1Meter, SessyBattery, get_sessy_device

async def run():
devices: list(SessyDevice) = [
await get_sessy_device(SESSY_BATTERY_HOST, SESSY_BATTERY_USERNAME, SESSY_BATTERY_PASSWORD),
await get_sessy_device(SESSY_P1_HOST, SESSY_P1_USERNAME, SESSY_P1_PASSWORD),
]
devices = list()

devices.append(
await get_sessy_device(SESSY_BATTERY_HOST, SESSY_BATTERY_USERNAME, SESSY_BATTERY_PASSWORD)
)
devices.append(
await get_sessy_device(SESSY_P1_HOST, SESSY_P1_USERNAME, SESSY_P1_PASSWORD)
)
device: SessyDevice
for device in devices:
print(f"=== Sessy Device at { device.host } ===")
Expand Down Expand Up @@ -36,6 +40,12 @@ async def run():
result = await device.get_system_settings()
print(result)
print("")

print("- Dynamic mode schedule -")
result = await device.get_dynamic_schedule()
print(result)
print("")

elif isinstance(device, SessyP1Meter):
print("- P1 Status -")
result = await device.get_p1_status()
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "sessypy"
version = "0.1.8"
version = "0.1.9"
authors = [
{ name="PimDoos" },
]
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = sessypy
version = 0.1.8
version = 0.1.9
author = PimDoos
url = https://github.com/PimDoos/sessypy
long_description = file: README.md
Expand Down
2 changes: 1 addition & 1 deletion src/sessypy/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class SessyApiCommand(str, Enum):
CT_DETAILS = f"{API_VERSION_1}/ct/details"
DYNAMIC_SCHEDULE = f"{API_VERSION_2}/dynamic/schedule"
DYNAMIC_SCHEDULE = f"{API_VERSION_1}/dynamic/schedule"

METER_GRID_TARGET = f"{API_VERSION_1}/meter/grid_target"

Expand Down

0 comments on commit a452b54

Please sign in to comment.