Set a motion on the puppet.
(self, motion)
| 64 | return {} |
| 65 | |
| 66 | def set_motion(self, motion): |
| 67 | """Set a motion on the puppet.""" |
| 68 | try: |
| 69 | response = requests.post( |
| 70 | f"{self.base_url}/motion", |
| 71 | json={"motion": motion}, |
| 72 | timeout=2 |
| 73 | ) |
| 74 | response.raise_for_status() |
| 75 | return True |
| 76 | except requests.RequestException: |
| 77 | return False |
| 78 | |
| 79 | def set_settings(self, settings): |
| 80 | """Update puppet settings.""" |
no outgoing calls
no test coverage detected