-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potentially a new bug. #447
Comments
The .Cloud() functions do not retry failed requests except for a single retry after getting a 'token invalid' (auth token expired) response. The |
I found this and i'm not sure how i would set that up do i put the commands in your cloud.py files or can i put it in my script even if my script only calls on the cloud switching from importing it.
|
how do i make the |
I would try something like this... import logging
import tinytuya
# Configure logging
logging.basicConfig(filename='tinytuya.log', level=logging.DEBUG)
# Create a logger
logger = logging.getLogger('tinytuya')
# Replace the default logger in tinytuya with the configured logger
tinytuya.set_logger(logger) |
Hi @jasonacox hows it going ?
I wonder if there is a way to limit the amount of retries
tinytuya.Cloud()
has?I believe its 3 by default and wondering if i can make it 1 try instead?
Let me explain what is happening, I don't have any errors when this happens it's just sometime very occasionally when i trigger the cloud turn off action it just sits there trying for a very long time before succeeding in actually turning off the specific light.
I have 2 wireless kinetic switches (very cool no batteries needed) and the BASE is wired up to my rpi.
When the switch is pressed the rpi detects the activity. I have a service i created on the pi that runs the Light_switch.py inside that it imports another file i made called room_controller.py and that is where your code is for turning various lights on and off by calling light_off(name of device) so my question is when i have the strange time issue can i have the room_controller.py only try the light once.
If it fails call for service to restart Light_switch with debug of tuya set to true.
that means next time it happens i get to potentially catch the error.
The only other option is i start with debug flag on all the time however that shows so much info even when everything is fine is there a way to hide the debug messages away in a file.
So when the error happens i can just look at the last few entries ?
What do you think ?
The text was updated successfully, but these errors were encountered: