kuzjka / lighthouse-community

Power line status reporting service
0 stars 0 forks source link

SensorService implementation #13

Closed kuzjka closed 1 week ago

kuzjka commented 3 weeks ago

Create first basic implementation of SensorService. See the design suggestion at https://github.com/kuzjka/lighthouse-community/wiki/Server-app-design-v0.1

Service stores the state of the sensor and the date of last report from the sensor. Also it regularly runs a scheduled task to check the last report timestamp.

To decouple this service from notifiers - Spring application events are used.

We have 2 parameters for this routine:

Parameter Description Default value
checkRate How often to check sensor state 30 seconds
sensorTimeout If no reports were received during this amount of time - the sensor is considered unpowered 1 minute

Following describes the change between states:

Please see the following links to learn about Spring features needed:

Prefer annotation-based configuration for both of these features.