Breaking Change
Aioshelly has migrated to its own COAP implementation. Updated usage instructions:
python
import asyncio
from pprint import pprint
import aiohttp
import aioshelly
async def main():
options = aioshelly.ConnectionOptions("192.168.1.165", "username", "password")
async with aiohttp.ClientSession() as aiohttp_session, aioshelly.COAP() as coap_context:
try:
device = await asyncio.wait_for(
aioshelly.Device.create(aiohttp_session, coap_context, options), 5
)
except asyncio.TimeoutError:
print("Timeout connecting to", ip)
return
for block in device.blocks:
print(block)
pprint(block.current_values())
print()
if __name__ == "__main__":
asyncio.run(main())
What's Changed
* Use datagram transport to send data + fix mypy (39) balloob
* Fix for no CoAP context (verify.py) (38) chemelli74
* Cleanup aiocoap leftovers (37) chemelli74
* Example.py: introduction of devices external list (36) chemelli74
* Swap from aiocoap to own CoAP handler (33) chemelli74
* Add pylint to pre-commit (35) chemelli74
* Fix pre-commit (34) chemelli74
* Bump isort from 5.6.3 to 5.6.4 (32) dependabot