File: report.py

package info (click to toggle)
python-powerfox 2.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 780 kB
  • sloc: python: 906; makefile: 3
file content (25 lines) | stat: -rw-r--r-- 628 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""Example for the Powerfox report endpoint."""

import asyncio

from powerfox import Powerfox


async def main() -> None:
    """Show example on getting report data."""
    async with Powerfox(username="EMAIL_ADDRESS", password="PASSWORD") as client:
        report = await client.report(device_id="DEVICE_ID")
        print(report)

        # Example with date filters (year/month/day)
        report_filtered = await client.report(
            device_id="DEVICE_ID",
            year=2024,
            month=12,
            day=6,
        )
        print(report_filtered)


if __name__ == "__main__":
    asyncio.run(main())