Comments (2)
Found the problem: Windows and asynchio
Solution: Add the following into the end of the code
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) asyncio.run(main())
from surepy.
Ran up against a second chellenge. The code now starts to run, but throws a different error:
Traceback (most recent call last): File "Z:\programming\python\surepy_testing\catflap_test.py", line 42, in <module> asyncio.run(main()) File "C:\Program Files\Python39\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Program Files\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete return future.result() File "Z:\programming\python\surepy_testing\catflap_test.py", line 24, in main pets: List[Pet] = await surepy.get_pets() File "C:\Users\rob_r\AppData\Roaming\Python\Python39\site-packages\surepy\__init__.py", line 297, in get_pets return [pet for pet in (await self.get_entities()).values() if isinstance(pet, Pet)] File "C:\Users\rob_r\AppData\Roaming\Python\Python39\site-packages\surepy\__init__.py", line 349, in get_entities if response := await self.sac.call(method="GET", resource=MESTART_RESOURCE): File "C:\Users\rob_r\AppData\Roaming\Python\Python39\site-packages\surepy\client.py", line 218, in call self._auth_token = await self.get_token() File "C:\Users\rob_r\AppData\Roaming\Python\Python39\site-packages\surepy\client.py", line 188, in get_token raise SurePetcareError() surepy.exceptions.SurePetcareError
from surepy.
Related Issues (20)
- Package dependency conflicts
- Mark cat as inside/outside when they "look through" HOT 1
- Pet profile HOT 2
- Authentication Issues (via HomeAssistant HOT 1
- SurePy initializes with 'TypeError: object of type 'int' has no len()' HOT 3
- get_token() raise exception HOT 2
- Add support for setting LED status
- Pet Door curfew no longer reporting lock status HOT 3
- having issues logging in HOT 25
- Longer tokens are not supported HOT 9
- Log error: "error while setting up sureha platform for sensor"
- Disconnected Flap -> Connect status does not change
- Cat Flap entity picture changes only after hours / reloading
- Pet State Changes Randomly
- SurePy.Client Get app.api.surehub.io/api/report/household/xyz/: 404 HOT 4
- Exception from set_curfew API (daylight saving change related?) HOT 5
- Surepy CLI request token doesn't return token HOT 1
- Incorrect initialisation of PetLocationData.since
- Fixed number of entries
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from surepy.