Skip to content

Commit 22e8d65

Browse files
Fix ma/mpc usecase to validate the correct actor type (#107)
The ma/mpc usecase should filter for actors of type MonitoredUnit but was filtering for actors of type MonitoringAppliance which lead to the uc never finding any entities. This PR also adds a commit which adjusts the string representation of the ma/mpc UseCaseSupportUpdate EventType from "ma-mpc-oscev-UseCaseSupportUpdate" to "ma-mpc-UseCaseSupportUpdate" as it isn't relevant here. This is technically an API-breaking change, but all subscribers should be using the constant mpc.UseCaseSupportUpdate instead of its string representation and therefore automatically always use the correct variant for their version of eebus-go. I could, however, drop the commit from this PR if preferred.
2 parents bbc6418 + 9736aaa commit 22e8d65

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

usecases/ma/mpc/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const (
66
// Update of the list of remote entities supporting the Use Case
77
//
88
// Use `RemoteEntities` to get the current data
9-
UseCaseSupportUpdate api.EventType = "ma-mpc-oscev-UseCaseSupportUpdate"
9+
UseCaseSupportUpdate api.EventType = "ma-mpc-UseCaseSupportUpdate"
1010

1111
// Total momentary active power consumption or production
1212
//

usecases/ma/mpc/usecase.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type MPC struct {
1616
var _ ucapi.MaMPCInterface = (*MPC)(nil)
1717

1818
func NewMPC(localEntity spineapi.EntityLocalInterface, eventCB api.EntityEventCallback) *MPC {
19-
validActorTypes := []model.UseCaseActorType{model.UseCaseActorTypeMonitoringAppliance}
19+
validActorTypes := []model.UseCaseActorType{model.UseCaseActorTypeMonitoredUnit}
2020
validEntityTypes := []model.EntityTypeType{
2121
model.EntityTypeTypeCompressor,
2222
model.EntityTypeTypeElectricalImmersionHeater,

0 commit comments

Comments
 (0)