uclpc

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Load control obligation limit data updated
	//
	// Use `ConsumptionLimit` to get the current data
	//
	// Use Case LPC, Scenario 1
	DataUpdateLimit api.EventType = "DataUpdateLimit"

	// Failsafe limit for the consumed active (real) power of the
	// Controllable System data updated
	//
	// Use `FailsafeConsumptionActivePowerLimit` to get the current data
	//
	// Use Case LPC, Scenario 2
	DataUpdateFailsafeConsumptionActivePowerLimit api.EventType = "DataUpdateFailsafeConsumptionActivePowerLimit"

	// Minimum time the Controllable System remains in "failsafe state" unless conditions
	// specified in this Use Case permit leaving the "failsafe state" data updated
	//
	// Use `FailsafeDurationMinimum` to get the current data
	//
	// Use Case LPC, Scenario 2
	DataUpdateFailsafeDurationMinimum api.EventType = "DataUpdateFailsafeDurationMinimum"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UCLPC

type UCLPC struct {
	// contains filtered or unexported fields
}

func NewUCLPC

func NewUCLPC(service eebusapi.ServiceInterface, eventCB api.EntityEventCallback) *UCLPC

func (*UCLPC) AddFeatures

func (e *UCLPC) AddFeatures()

func (*UCLPC) AddUseCase

func (e *UCLPC) AddUseCase()

func (*UCLPC) ConsumptionLimit

func (e *UCLPC) ConsumptionLimit(entity spineapi.EntityRemoteInterface) (
	limit api.LoadLimit, resultErr error)

return the current loadcontrol limit data

parameters:

  • entity: the entity of the e.g. EVSE

return values:

  • limit: load limit data

possible errors:

  • ErrDataNotAvailable if no such limit is (yet) available
  • and others

func (*UCLPC) FailsafeConsumptionActivePowerLimit

func (e *UCLPC) FailsafeConsumptionActivePowerLimit(entity spineapi.EntityRemoteInterface) (float64, error)

return Failsafe limit for the consumed active (real) power of the Controllable System. This limit becomes activated in "init" state or "failsafe state".

func (*UCLPC) FailsafeDurationMinimum

func (e *UCLPC) FailsafeDurationMinimum(entity spineapi.EntityRemoteInterface) (time.Duration, error)

return minimum time the Controllable System remains in "failsafe state" unless conditions specified in this Use Case permit leaving the "failsafe state"

func (*UCLPC) HandleEvent

func (e *UCLPC) HandleEvent(payload spineapi.EventPayload)

handle SPINE events

func (*UCLPC) IsUseCaseSupported

func (e *UCLPC) IsUseCaseSupported(entity spineapi.EntityRemoteInterface) (bool, error)

returns if the entity supports the usecase

possible errors:

  • ErrDataNotAvailable if that information is not (yet) available
  • and others

func (*UCLPC) PowerConsumptionNominalMax

func (e *UCLPC) PowerConsumptionNominalMax(entity spineapi.EntityRemoteInterface) (float64, error)

return nominal maximum active (real) power the Controllable System is able to consume according to the device label or data sheet.

func (*UCLPC) UpdateUseCaseAvailability

func (e *UCLPC) UpdateUseCaseAvailability(available bool)

func (*UCLPC) UseCaseName

func (c *UCLPC) UseCaseName() model.UseCaseNameType

func (*UCLPC) WriteConsumptionLimit

func (e *UCLPC) WriteConsumptionLimit(
	entity spineapi.EntityRemoteInterface,
	limit api.LoadLimit) (*model.MsgCounterType, error)

send new LoadControlLimits

parameters:

  • entity: the entity of the e.g. EVSE
  • limit: load limit data

func (*UCLPC) WriteFailsafeConsumptionActivePowerLimit

func (e *UCLPC) WriteFailsafeConsumptionActivePowerLimit(entity spineapi.EntityRemoteInterface, value float64) (*model.MsgCounterType, error)

send new Failsafe Consumption Active Power Limit

parameters:

  • entity: the entity of the e.g. EVSE
  • value: the new limit in W

func (*UCLPC) WriteFailsafeDurationMinimum

func (e *UCLPC) WriteFailsafeDurationMinimum(entity spineapi.EntityRemoteInterface, duration time.Duration) (*model.MsgCounterType, error)

send new Failsafe Duration Minimum

parameters:

  • entity: the entity of the e.g. EVSE
  • duration: the duration, between 2h and 24h

type UCLPCInterface

type UCLPCInterface interface {
	api.UseCaseInterface

	// return the current consumption limit data
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//
	// return values:
	//   - limit: load limit data
	//
	// possible errors:
	//   - ErrDataNotAvailable if no such limit is (yet) available
	//   - and others
	ConsumptionLimit(entity spineapi.EntityRemoteInterface) (limit api.LoadLimit, resultErr error)

	// send new LoadControlLimits
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//   - limit: load limit data
	WriteConsumptionLimit(entity spineapi.EntityRemoteInterface, limit api.LoadLimit) (*model.MsgCounterType, error)

	// return Failsafe limit for the consumed active (real) power of the
	// Controllable System. This limit becomes activated in "init" state or "failsafe state".
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//
	// return values:
	//   - positive values are used for consumption
	FailsafeConsumptionActivePowerLimit(entity spineapi.EntityRemoteInterface) (float64, error)

	// send new Failsafe Consumption Active Power Limit
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//   - value: the new limit in W
	WriteFailsafeConsumptionActivePowerLimit(entity spineapi.EntityRemoteInterface, value float64) (*model.MsgCounterType, error)

	// return minimum time the Controllable System remains in "failsafe state" unless conditions
	// specified in this Use Case permit leaving the "failsafe state"
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//
	// return values:
	//   - negative values are used for production
	FailsafeDurationMinimum(entity spineapi.EntityRemoteInterface) (time.Duration, error)

	// send new Failsafe Duration Minimum
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	//   - duration: the duration, between 2h and 24h
	WriteFailsafeDurationMinimum(entity spineapi.EntityRemoteInterface, duration time.Duration) (*model.MsgCounterType, error)

	// return nominal maximum active (real) power the Controllable System is
	// able to consume according to the device label or data sheet.
	//
	// parameters:
	//   - entity: the entity of the e.g. EVSE
	PowerConsumptionNominalMax(entity spineapi.EntityRemoteInterface) (float64, error)
}

interface for the Limitation of Power Consumption UseCase

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL