Compare commits
2 Commits
3b0748da25
...
59f5bfbba1
Author | SHA1 | Date | |
---|---|---|---|
59f5bfbba1 | |||
0adab13221 |
5
TODO.md
5
TODO.md
@ -1,13 +1,14 @@
|
||||
# Issues
|
||||
- [ ] Redis recorder panic
|
||||
- [x] Redis recorder panic
|
||||
|
||||
# TODO
|
||||
- [ ] Stop Marshaling sensors / batteries with no data
|
||||
- [ ] Add json schema to CI and README
|
||||
- [ ] Finish implementing weather GRPC
|
||||
- [ ] Update README
|
||||
- [ ] Add Grafana dashboard
|
||||
|
||||
## Done
|
||||
- [x] Finish implementing weather GRPC
|
||||
- [x] Add json schema for config
|
||||
- [x] Add new spans
|
||||
- [x] Helm Chart
|
||||
|
@ -15,13 +15,13 @@ type: application
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.3
|
||||
version: 0.1.4
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "v0.11.0"
|
||||
appVersion: "v0.11.2"
|
||||
|
||||
dependencies:
|
||||
- name: hull
|
||||
|
@ -1,6 +1,8 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"slices"
|
||||
|
||||
pb "gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/api/v1alpha1/weather"
|
||||
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/util"
|
||||
"gitea.libretechconsulting.com/rmcguire/ambient-local-exporter/pkg/weather"
|
||||
@ -47,24 +49,28 @@ func UpdateToPbUpdate(u *weather.WeatherUpdate) *pb.WeatherUpdate {
|
||||
}
|
||||
|
||||
func batteriesToPbBatteries(batteries []weather.BatteryStatus) []*pb.BatteryStatus {
|
||||
pbBatteries := make([]*pb.BatteryStatus, len(batteries))
|
||||
for i, b := range batteries {
|
||||
pbBatteries[i] = &pb.BatteryStatus{
|
||||
Component: b.Component,
|
||||
Status: util.Int32ptr(b.Status),
|
||||
pbBatteries := make([]*pb.BatteryStatus, 0, len(batteries))
|
||||
for _, b := range batteries {
|
||||
if b.Status != nil {
|
||||
pbBatteries = append(pbBatteries, &pb.BatteryStatus{
|
||||
Component: b.Component,
|
||||
Status: util.Int32ptr(b.Status),
|
||||
})
|
||||
}
|
||||
}
|
||||
return pbBatteries
|
||||
return slices.Clip(pbBatteries)
|
||||
}
|
||||
|
||||
func thSensorsToPbSensors(sensors []*weather.TempHumiditySensor) []*pb.TempHumiditySensor {
|
||||
pbSensors := make([]*pb.TempHumiditySensor, len(sensors))
|
||||
for i, s := range sensors {
|
||||
pbSensors[i] = &pb.TempHumiditySensor{
|
||||
Name: s.Name,
|
||||
TempF: s.TempF,
|
||||
Humidity: util.Int32ptr(s.Humidity),
|
||||
pbSensors := make([]*pb.TempHumiditySensor, 0, len(sensors))
|
||||
for _, s := range sensors {
|
||||
if s.TempF != nil || s.Humidity != nil {
|
||||
pbSensors = append(pbSensors, &pb.TempHumiditySensor{
|
||||
Name: s.Name,
|
||||
TempF: s.TempF,
|
||||
Humidity: util.Int32ptr(s.Humidity),
|
||||
})
|
||||
}
|
||||
}
|
||||
return pbSensors
|
||||
return slices.Clip(pbSensors)
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ func (r *RedisRecorder) get(ctx context.Context, req *pb.GetWeatherRequest) (
|
||||
Int("updatesFiltered", len(updates)-len(filtered)).
|
||||
Msg("updates retrieved from redis")
|
||||
|
||||
return updates, err
|
||||
return filtered, err
|
||||
}
|
||||
|
||||
func jsonDatasToUpdates(datas []string) ([]*weather.WeatherUpdate, error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user