@@ -14,7 +14,6 @@ import (
1414 "time"
1515
1616 "github.com/enbility/eebus-go/api"
17- "github.com/enbility/eebus-go/features/server"
1817 "github.com/enbility/eebus-go/service"
1918 ucapi "github.com/enbility/eebus-go/usecases/api"
2019 "github.com/enbility/eebus-go/usecases/cem/vabd"
@@ -94,7 +93,7 @@ func (h *hems) run() {
9493 configuration .SetAlternateIdentifier ("Demo-HEMS-123456789" )
9594
9695 h .myService = service .NewService (configuration , h )
97- h .myService .SetLogging (h )
96+ // h.myService.SetLogging(h)
9897
9998 if err = h .myService .Setup (); err != nil {
10099 fmt .Println (err )
@@ -161,22 +160,9 @@ func (h *hems) OnLPCEvent(ski string, device spineapi.DeviceRemoteInterface, ent
161160 h .uccslpc .ApproveOrDenyConsumptionLimit (msgCounter , true , "" )
162161 }
163162 for msgCounter , configs := range pendingDeviceConfigWrites {
164- localEntity := h .myService .LocalDevice ().EntityForType (model .EntityTypeTypeCEM )
165- dc , err := server .NewDeviceConfiguration (localEntity )
166- if err != nil {
167- fmt .Println ("Not approving LPC device configuration writes because of error:" )
168- fmt .Println (err )
169- return
170- }
171- fmt .Printf ("Approving LPC device config write with msgCounter %d " , msgCounter )
163+ fmt .Printf ("Approving LPC device config write with msgCounter %d for features: " , msgCounter )
172164 for _ , config := range (configs ) {
173- description , err := dc .GetKeyValueDescriptionFoKeyId (* config .KeyId )
174- if description == nil || err != nil {
175- fmt .Printf ("LPC approving device configuation writes: no device configuration for KeyID %d found\n " , * config .KeyId )
176- continue
177- }
178-
179- fmt .Printf ("including %s " , * description .KeyName )
165+ fmt .Printf ("%s " , * config .Description .KeyName )
180166 }
181167 fmt .Print ("\n " )
182168 h .uccslpc .ApproveOrDenyDeviceConfiguration (msgCounter , true , "" )
@@ -203,25 +189,12 @@ func (h *hems) OnLPPEvent(ski string, device spineapi.DeviceRemoteInterface, ent
203189 h .uccslpp .ApproveOrDenyProductionLimit (msgCounter , true , "" )
204190 }
205191 for msgCounter , configs := range pendingDeviceConfigWrites {
206- localEntity := h .myService .LocalDevice ().EntityForType (model .EntityTypeTypeCEM )
207- dc , err := server .NewDeviceConfiguration (localEntity )
208- if err != nil {
209- fmt .Println ("Not approving LPC device configuration writes because of error:" )
210- fmt .Println (err )
211- return
212- }
213-
214- fmt .Printf ("Approving LPP device config write with msgCounter %d " , msgCounter )
192+ fmt .Printf ("Approving LPP device config write with msgCounter %d for features: " , msgCounter )
215193 for _ , config := range (configs ) {
216- description , err := dc .GetKeyValueDescriptionFoKeyId (* config .KeyId )
217- if description == nil || err != nil {
218- fmt .Printf ("LPP approving device configuation writes: no device configuration for KeyID %d found\n " , * config .KeyId )
219- continue
220- }
221- fmt .Printf ("including %s " , * description .KeyName )
194+ fmt .Printf ("%s " , * config .Description .KeyName )
222195 }
223196 fmt .Print ("\n " )
224- h .uccslpc .ApproveOrDenyDeviceConfiguration (msgCounter , true , "" )
197+ h .uccslpp .ApproveOrDenyDeviceConfiguration (msgCounter , true , "" )
225198 }
226199 case cslpp .DataUpdateLimit :
227200 if currentLimit , err := h .uccslpp .ProductionLimit (); err != nil {
0 commit comments