Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename (again) the data entities #10

Merged
merged 1 commit into from
Aug 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions omnikinverter/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ class Inverter:
serial_number: str | None
model: str | None
firmware: str | None
current_power: int | None
energy_today: float | None
energy_total: float | None
solar_current_power: int | None
solar_energy_today: float | None
solar_energy_total: float | None

@staticmethod
def from_js(data: dict[str, Any]) -> Inverter:
Expand Down Expand Up @@ -43,7 +43,7 @@ def get_values(position):
serial_number=get_values(0),
model=get_values(3),
firmware=get_values(2),
current_power=get_values(5),
energy_today=get_values(6),
energy_total=get_values(7),
solar_current_power=get_values(5),
solar_energy_today=get_values(6),
solar_energy_total=get_values(7),
)
6 changes: 3 additions & 3 deletions test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ async def main():
print(f"Serial Number: {inverter.serial_number}")
print(f"Model: {inverter.model}")
print(f"Firmware: {inverter.firmware}")
print(f"Current Power: {inverter.current_power}")
print(f"Energy Production Today: {inverter.energy_today}")
print(f"Energy Production Total: {inverter.energy_total}")
print(f"Current Power: {inverter.solar_current_power}")
print(f"Energy Production Today: {inverter.solar_energy_today}")
print(f"Energy Production Total: {inverter.solar_energy_total}")


if __name__ == "__main__":
Expand Down