Created
March 6, 2023 16:53
-
-
Save smitmartijn/8fd1006326cc49b26691f71c3b15d46d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from Smile import Smile | |
import json | |
async def main(): | |
smile = Smile("192.168.0.0", "password") | |
await smile.connect() | |
await smile.update_locations() | |
# Get the current power consumption in watts | |
current_power = smile.get_power_data_from_location("location-id") | |
print(json.dumps(current_power)) | |
await smile.close_connection() | |
if __name__ == '__main__': | |
loop = asyncio.get_event_loop() | |
loop.run_until_complete(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment