Closed ptyers closed 3 years ago
I believe its as good as I can get it now. Added routine camera_api.set_spotlight_lighting_schedule( endhour, endminite, starthour, startminute)
Attached files are test outputs from my testing suite. If I attempt to use test.py I get an error messge - RuntimeError: Timeout context manager should be used inside a task whiteledtest.txt
Test Results - Unittests_for_test_camera_api_TestApi.zip test_camera_api.zip
What, if anything do you need me to do now?
Hi @ptyers ,
It looks amazing. My only issue is that the diff shows you have changed every single line of code in the files you changed. I suspect you are using the wrong line return (\n vs \r\n). Can you please check and fix your commit?
Thank you
Will do. I noticed that myself and meant to ask about it. Still navigating my way around git/github, I have used it in the past but only for projects where I am the only contributor so the cr/nl vs nl had not been a problem.On 22 Nov 2021 19:11, Christophe Painchaud @.***> wrote: Hi @ptyers , It looks amazing. My only issue is that the diff shows you have changed every single line of code in the files you changed. I suspect you are using the wrong line return (\n vs \r\n). Can you please check and fix your commit? Thank you
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.
no worries, most of the time IDEs will auto detect what the project is using, it looks like it failed for you :)
A possible contribution to partially meet the request in reolink_dev discussion 293
I have added routines and statements to get settings/status for the WhiteLed (Spotlight) capability provided by various Reolink cameras,
I have added a set routine to allow setting the parameters for On/Off, brightness and whether AUTO on NightMode or Set Time in NoghtMode. I have not (yet) provided facility to set the Start_hour/Start_min/End_hour/End_Min rewlated to the Spotlight on when NightMode set and mode=3 (Spotlight on continuously during time period)
I was unable to run Test.py using my IDE (Pycharm) under either pyTest or Unittests. I created an ancilliary Test file, which is attached and which I agree is not pretty but it seems to cover the use cases. Also attached copies of test outputs.
While working I also replaced two reference to deprecated verify-ssl= which I replaced with ssl= as per recommendation of Pycharm. Lines 117 and 1188.
Eventual aim is that reolink_dev will be able to provide control/status of camera spotlight as and when necessary under Home Assistant
The tests I ran with my Reolink Duo appeared to do physically what I requested, the routines are untested with any other Reolink Camera.
Properties whiteled_state
Routine set_whiteled(self, enable, new_bright, new_mode=None) parameters enable : True/Fa;lse == On/Off new_bright: range 0 to 100 , brightness percent new_mode: [0,1,3] 0 == Night Mode Off 1 == NightMode On, AUTO 3 == NightMode On, Light remains on within time period. I have made an assumption if mode not specified it will be 1. Commands and modes have been derived from document "Camera HTTP API User Guide", Vesion 4 2019-9 presumably published by Reolink although their Australian support office was unaware of it. There are a number of errors in relation to WhiteLed , the data reurned by GetWhiteLed is truncated. The POST command for SetWhiteLed has a typo using GetWhiteLed rather than SetWhiteLed and the POST command does not include the param WhiteLed which has parameters state, channel mode and bright.
I hope this submission meets your standards
Test Results - Unittests_for_test_camera_api_TestApi.zip test run output.txt test_camera_api.zip