ovirs / pyvivint

python library for interacting with vivintsky API
MIT License
3 stars 1 forks source link

how to change states on devices using pyvivint #11

Open swincher4391 opened 3 years ago

swincher4391 commented 3 years ago

I looked at demo.py and was able to print out my devices... cool. Now how do I use mutator functions to do things like bypass a wireless sensor?

natekspencer commented 3 years ago

Sensors currently don't have a function to do that. I don't ever bypass my sensors manually, so it never came up to code a function to do so.

It's an easy addition though. Just a PUT request to {{base_url}}/{{panel_id}}/{{partition_id}}/sensors/{{device_id}} with:

{
  "b": <bypass_value>
}

where bypass_value is 0 for unbypassed, 1 for force bypassed and 2 for manually bypassed.

I'll get around to it later unless you want to take care of this one @ovirs?

swincher4391 commented 3 years ago

I would do that in vivintskyapi?

natekspencer commented 3 years ago

Yeah, you could copy the set_lock_state function and modify it for the sensor command

swincher4391 commented 3 years ago

I’ll give it a go, thank you.

Sent from my iPhone

On Feb 10, 2021, at 10:17 PM, Nathan Spencer notifications@github.com wrote:

 Yeah, you could copy the set_lock_state function and modify it for the sensor command

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.