Interface to the unofficial EcoNet API
Project description
pyeconet
Python3 interface to the unofficial EcoNet API.
NOTE This isn't using an official EcoNet API therefore this library could stop working at any time, without warning.
import asyncio
import logging
import time
import getpass
from pyeconet import EcoNetApiInterface
from pyeconet.equipment import EquipmentType
from pyeconet.equipment.water_heater import WaterHeaterOperationMode
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
async def main():
email = input("Enter your email: ").strip()
password = "" #getpass.getpass(prompt='Enter your password: ')
api = await EcoNetApiInterface.login(email, password=password)
all_equipment = await api.get_equipment_by_type([EquipmentType.WATER_HEATER, EquipmentType.THERMOSTAT])
#api.subscribe()
#await asyncio.sleep(5)
for equip_list in all_equipment.values():
for equipment in equip_list:
print(f"Name: {equipment.device_name}")
# print(f"Set point: {equipment.set_point}")
# print(f"Supports modes: {equipment._supports_modes()}")
# print(f"Operation modes: {equipment.modes}")
# print(f"Operation mode: {equipment.mode}")
#await equipment._get_energy_usage()
#equipment.set_set_point(equipment.set_point + 1)
#equipment.set_mode(OperationMode.ELECTRIC_MODE)
#await asyncio.sleep(300000)
#api.unsubscribe()
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyeconet-0.1.23.tar.gz
(12.6 kB
view details)
Built Distribution
pyeconet-0.1.23-py3-none-any.whl
(14.0 kB
view details)
File details
Details for the file pyeconet-0.1.23.tar.gz
.
File metadata
- Download URL: pyeconet-0.1.23.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d04ef612782c770ab2ebad7895f8c744164a0ec45fcd9ef76f315d01f2c6830 |
|
MD5 | f3193c939369cea1d5a8decd0842caa8 |
|
BLAKE2b-256 | a709c954d135c1274528acc254c2632c9d45130613c63a50851b90d9938e4478 |
File details
Details for the file pyeconet-0.1.23-py3-none-any.whl
.
File metadata
- Download URL: pyeconet-0.1.23-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 297cf0d9bfb07c773c9b1bc6f5c4b1c73e80e590eaa15a40cec8d99cb085a95c |
|
MD5 | 1e4b17c163309f6e3ffc4459ad411c2e |
|
BLAKE2b-256 | f57b2d0b9d89014389252026a5af7c19861860f1c47d7dd156cfe1b19f66e95e |