Commit Graph

36 Commits

Author SHA1 Message Date
ᗪєνιη ᗷυнʟ
10ab70080a
fix: consistent error logging to mqtt connection issues (#1578) 2021-08-24 07:59:31 -05:00
Jason Hunter
c527b1ca5d change MQTT to toggle recordings instead of clips 2021-08-07 15:51:16 -05:00
Blake Blackshear
f892a821f5 no need to worry about payload here 2021-07-06 07:36:37 -05:00
ElMoribond
a4052a9fe5 Add ability to restart 2021-07-06 07:36:37 -05:00
Blake Blackshear
cbdf2c2c71 remove gevent fixes #920 2021-06-14 07:48:35 -05:00
Mingkwan Burckhardt
8dfff83447 Added support for authentication with client certificate with MQTT broker 2021-06-06 07:57:46 -05:00
Sean Vig
84a0827aee Use dataclasses for config handling
Use config data classes to eliminate some of the boilerplate associated
with setting up the configuration.  In particular, using dataclasses
removes a lot of the boilerplate around assigning properties to the
object and allows these to be easily immutable by freezing them.  In the
case of simple, non-nested dataclasses, this also provides more
convenient `asdict` helpers.

To set this up, where previously the objects would be parsed from the
config via the `__init__` method, create a `build` classmethod that does
this and calls the dataclass initializer.

Some of the objects are mutated at runtime, in particular some of the
zones are mutated to set the color (this might be able to be refactored
out) and some of the camera functionality can be enabled/disabled.  Some
of the configs with `enabled` properties don't seem to have mqtt hooks
to be able to toggle this, in particular, the clips, snapshots, and
detect can be toggled but rtmp and record configs do not, but all of
these configs are still not frozen in case there is some other
functionality I am missing.

There are a couple other minor fixes here, one that was introduced
by me recently where `max_seconds` was not defined, the other to
properly `get()` the message payload when handling publishing mqtt
messages sent via websocket.
2021-05-23 20:38:57 -05:00
Blake Blackshear
39ff49e054 formatting cleanup 2021-02-25 07:01:57 -06:00
Blake Blackshear
1a7853a47e subscribe in the connect callback (fixes #814) 2021-02-20 08:20:17 -06:00
Blake Blackshear
eed8463832 relay messages from sockets to mqtt 2021-02-20 08:20:17 -06:00
Blake Blackshear
4a85156e87 fix initial switch state 2021-01-26 21:40:33 -06:00
Blake Blackshear
1e84f08018 fix mqtt switch handling 2021-01-26 21:40:33 -06:00
Blake Blackshear
47ac77dbb0 mqtt tweaks for switches 2021-01-26 21:40:33 -06:00
Blake Blackshear
89e02b6956 add detection enable to config
fixes #482
2021-01-26 21:40:33 -06:00
Blake Blackshear
39040c1874 enable and disable detection via mqtt 2021-01-26 21:40:33 -06:00
Blake Blackshear
a9afa303a2 turn off snapshots via mqtt 2021-01-26 21:40:33 -06:00
Blake Blackshear
e5399ae07a enable turning clips on and off via mqtt 2021-01-26 21:40:33 -06:00
Blake Blackshear
75d62096a6 better exception handling 2021-01-26 21:40:33 -06:00
Blake Blackshear
03c855ecbe sort imports 2021-01-26 21:40:33 -06:00
Blake Blackshear
3a3cb24631 naming threads and processes for logs 2021-01-26 21:40:33 -06:00
Blake Blackshear
4c3fea25a5 use a queue for logging 2021-01-26 21:40:33 -06:00
Blake Blackshear
af303cbf2a create typed config classes 2021-01-26 21:40:33 -06:00
Blake Blackshear
36fbedab20 init db/http/mqtt 2021-01-26 21:40:33 -06:00
Blake Blackshear
569e07949f split into separate processes 2020-03-03 20:26:53 -06:00
Blake Blackshear
3a66e672d3 notify mqtt when objects deregistered 2020-02-22 09:03:00 -06:00
Blake Blackshear
d87f4407a0 switch everything to run off of tracked objects 2020-02-22 09:03:00 -06:00
Blake Blackshear
9cc46a71cb working dynamic regions, but messy 2020-02-22 09:03:00 -06:00
Blake Blackshear
b6130e77ff label threads and implements stats endpoint 2020-02-22 09:03:00 -06:00
Blake Blackshear
ab3e70b4db check to see if we have a frame before trying to send 2020-01-02 07:39:57 -06:00
Blake Blackshear
d90e408d50 set the current object status to off when expired 2020-01-02 07:39:57 -06:00
Blake Blackshear
bee99ca6ff track and report all detected object types 2020-01-02 07:39:57 -06:00
blakeblackshear
2ec45cd1b6 send the best person frame over mqtt for faster updates in homeassistant 2019-08-25 08:54:19 -05:00
blakeblackshear
e0b9b616ce cleanup and update readme 2019-03-30 07:58:31 -05:00
blakeblackshear
afb70f11a8 switch mqtt to a binary on/off instead of sending a message for each score 2019-03-12 20:54:43 -05:00
blakeblackshear
5dc76803d6 cleanup 2019-02-28 06:49:27 -06:00
blakeblackshear
86f5d8128d initial refactoring 2019-02-25 20:27:02 -06:00