@enyo-energy/energy-app-sdk 0.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +216 -0
- package/dist/cjs/connect-ems-api.cjs +2 -0
- package/dist/cjs/connect-ems-api.d.cts +30 -0
- package/dist/cjs/connect-ems-permission.enum.cjs +7 -0
- package/dist/cjs/connect-ems-permission.enum.d.cts +3 -0
- package/dist/cjs/connect-ems-permission.type.cjs +2 -0
- package/dist/cjs/connect-ems-permission.type.d.cts +1 -0
- package/dist/cjs/connect-package-definition.cjs +14 -0
- package/dist/cjs/connect-package-definition.d.cts +57 -0
- package/dist/cjs/energy-app-appliance-type.enum.cjs +14 -0
- package/dist/cjs/energy-app-appliance-type.enum.d.cts +10 -0
- package/dist/cjs/energy-app-package-configuration.cjs +2 -0
- package/dist/cjs/energy-app-package-configuration.d.cts +30 -0
- package/dist/cjs/energy-app-package-definition.cjs +30 -0
- package/dist/cjs/energy-app-package-definition.d.cts +123 -0
- package/dist/cjs/energy-app-permission.type.cjs +21 -0
- package/dist/cjs/energy-app-permission.type.d.cts +18 -0
- package/dist/cjs/enyo-energy-app-sdk.cjs +12 -0
- package/dist/cjs/enyo-energy-app-sdk.d.cts +67 -0
- package/dist/cjs/hems-one-energy-app-sdk.cjs +12 -0
- package/dist/cjs/hems-one-energy-app-sdk.d.cts +64 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusBattery.cjs +388 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusBattery.d.cts +59 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusConnectionHealth.cjs +37 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusConnectionHealth.d.cts +15 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusDataTypeConverter.cjs +130 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusDataTypeConverter.d.cts +41 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusFaultTolerantReader.cjs +49 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusFaultTolerantReader.d.cts +10 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusInverter.cjs +348 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusInverter.d.cts +56 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusMeter.cjs +199 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusMeter.d.cts +26 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusRegisterMapper.cjs +98 -0
- package/dist/cjs/implementations/modbus/EnergyAppModbusRegisterMapper.d.cts +13 -0
- package/dist/cjs/implementations/modbus/interfaces.cjs +29 -0
- package/dist/cjs/implementations/modbus/interfaces.d.cts +202 -0
- package/dist/cjs/implementations/ocpp/ocpp-common.cjs +337 -0
- package/dist/cjs/implementations/ocpp/ocpp-common.d.cts +75 -0
- package/dist/cjs/implementations/ocpp/ocpp16.cjs +51 -0
- package/dist/cjs/implementations/ocpp/ocpp16.d.cts +137 -0
- package/dist/cjs/implementations/ocpp/ocpp201.cjs +84 -0
- package/dist/cjs/implementations/ocpp/ocpp201.d.cts +215 -0
- package/dist/cjs/index.cjs +117 -0
- package/dist/cjs/index.d.cts +56 -0
- package/dist/cjs/mockConnectEmsApi.cjs +167 -0
- package/dist/cjs/mockConnectEmsApi.d.cts +10 -0
- package/dist/cjs/packages/connect-appliance.cjs +2 -0
- package/dist/cjs/packages/connect-appliance.d.cts +24 -0
- package/dist/cjs/packages/connect-http-api.cjs +2 -0
- package/dist/cjs/packages/connect-http-api.d.cts +15 -0
- package/dist/cjs/packages/connect-interval.cjs +2 -0
- package/dist/cjs/packages/connect-interval.d.cts +15 -0
- package/dist/cjs/packages/connect-modbus.cjs +2 -0
- package/dist/cjs/packages/connect-modbus.d.cts +60 -0
- package/dist/cjs/packages/connect-network-devices.cjs +2 -0
- package/dist/cjs/packages/connect-network-devices.d.cts +40 -0
- package/dist/cjs/packages/connect-storage.cjs +2 -0
- package/dist/cjs/packages/connect-storage.d.cts +14 -0
- package/dist/cjs/packages/energy-app-appliance.cjs +2 -0
- package/dist/cjs/packages/energy-app-appliance.d.cts +17 -0
- package/dist/cjs/packages/energy-app-authentication.cjs +2 -0
- package/dist/cjs/packages/energy-app-authentication.d.cts +52 -0
- package/dist/cjs/packages/energy-app-charge.cjs +2 -0
- package/dist/cjs/packages/energy-app-charge.d.cts +13 -0
- package/dist/cjs/packages/energy-app-charging-card.cjs +2 -0
- package/dist/cjs/packages/energy-app-charging-card.d.cts +11 -0
- package/dist/cjs/packages/energy-app-data-bus.cjs +2 -0
- package/dist/cjs/packages/energy-app-data-bus.d.cts +12 -0
- package/dist/cjs/packages/energy-app-electricity-prices.cjs +2 -0
- package/dist/cjs/packages/energy-app-electricity-prices.d.cts +59 -0
- package/dist/cjs/packages/energy-app-interval.cjs +2 -0
- package/dist/cjs/packages/energy-app-interval.d.cts +15 -0
- package/dist/cjs/packages/energy-app-modbus.cjs +2 -0
- package/dist/cjs/packages/energy-app-modbus.d.cts +46 -0
- package/dist/cjs/packages/energy-app-network-device.cjs +2 -0
- package/dist/cjs/packages/energy-app-network-device.d.cts +25 -0
- package/dist/cjs/packages/energy-app-notification.cjs +2 -0
- package/dist/cjs/packages/energy-app-notification.d.cts +50 -0
- package/dist/cjs/packages/energy-app-ocpp.cjs +16 -0
- package/dist/cjs/packages/energy-app-ocpp.d.cts +52 -0
- package/dist/cjs/packages/energy-app-settings.cjs +2 -0
- package/dist/cjs/packages/energy-app-settings.d.cts +47 -0
- package/dist/cjs/packages/energy-app-storage.cjs +2 -0
- package/dist/cjs/packages/energy-app-storage.d.cts +14 -0
- package/dist/cjs/packages/energy-app-vehicle.cjs +2 -0
- package/dist/cjs/packages/energy-app-vehicle.d.cts +11 -0
- package/dist/cjs/permission-not-granted.cjs +18 -0
- package/dist/cjs/permission-not-granted.d.cts +8 -0
- package/dist/cjs/types/connect-appliance-type.enum.cjs +10 -0
- package/dist/cjs/types/connect-appliance-type.enum.d.cts +6 -0
- package/dist/cjs/types/energy-app-settings.cjs +2 -0
- package/dist/cjs/types/energy-app-settings.d.cts +74 -0
- package/dist/cjs/types/enyo-appliance.cjs +33 -0
- package/dist/cjs/types/enyo-appliance.d.cts +81 -0
- package/dist/cjs/types/enyo-authentication.cjs +9 -0
- package/dist/cjs/types/enyo-authentication.d.cts +69 -0
- package/dist/cjs/types/enyo-battery-appliance.cjs +2 -0
- package/dist/cjs/types/enyo-battery-appliance.d.cts +6 -0
- package/dist/cjs/types/enyo-charge.cjs +15 -0
- package/dist/cjs/types/enyo-charge.d.cts +82 -0
- package/dist/cjs/types/enyo-charger-appliance.cjs +41 -0
- package/dist/cjs/types/enyo-charger-appliance.d.cts +49 -0
- package/dist/cjs/types/enyo-charging-card.cjs +2 -0
- package/dist/cjs/types/enyo-charging-card.d.cts +11 -0
- package/dist/cjs/types/enyo-data-bus-value.cjs +78 -0
- package/dist/cjs/types/enyo-data-bus-value.d.cts +379 -0
- package/dist/cjs/types/enyo-electricity-prices.cjs +2 -0
- package/dist/cjs/types/enyo-electricity-prices.d.cts +63 -0
- package/dist/cjs/types/enyo-energy-tariff.cjs +2 -0
- package/dist/cjs/types/enyo-energy-tariff.d.cts +70 -0
- package/dist/cjs/types/enyo-heatpump-appliance.cjs +19 -0
- package/dist/cjs/types/enyo-heatpump-appliance.d.cts +34 -0
- package/dist/cjs/types/enyo-inverter-appliance.cjs +2 -0
- package/dist/cjs/types/enyo-inverter-appliance.d.cts +3 -0
- package/dist/cjs/types/enyo-meter-appliance.cjs +10 -0
- package/dist/cjs/types/enyo-meter-appliance.d.cts +10 -0
- package/dist/cjs/types/enyo-network-device.cjs +2 -0
- package/dist/cjs/types/enyo-network-device.d.cts +31 -0
- package/dist/cjs/types/enyo-notification.cjs +2 -0
- package/dist/cjs/types/enyo-notification.d.cts +48 -0
- package/dist/cjs/types/enyo-settings.cjs +2 -0
- package/dist/cjs/types/enyo-settings.d.cts +74 -0
- package/dist/cjs/types/enyo-source.enum.cjs +8 -0
- package/dist/cjs/types/enyo-source.enum.d.cts +4 -0
- package/dist/cjs/types/enyo-vehicle.cjs +2 -0
- package/dist/cjs/types/enyo-vehicle.d.cts +12 -0
- package/dist/cjs/types/enyo-websocket-connection.cjs +2 -0
- package/dist/cjs/types/enyo-websocket-connection.d.cts +8 -0
- package/dist/cjs/types/hems-one-appliance.cjs +33 -0
- package/dist/cjs/types/hems-one-appliance.d.cts +81 -0
- package/dist/cjs/types/hems-one-authentication.cjs +9 -0
- package/dist/cjs/types/hems-one-authentication.d.cts +69 -0
- package/dist/cjs/types/hems-one-battery-appliance.cjs +2 -0
- package/dist/cjs/types/hems-one-battery-appliance.d.cts +6 -0
- package/dist/cjs/types/hems-one-charge.cjs +15 -0
- package/dist/cjs/types/hems-one-charge.d.cts +82 -0
- package/dist/cjs/types/hems-one-charger-appliance.cjs +41 -0
- package/dist/cjs/types/hems-one-charger-appliance.d.cts +49 -0
- package/dist/cjs/types/hems-one-charging-card.cjs +2 -0
- package/dist/cjs/types/hems-one-charging-card.d.cts +11 -0
- package/dist/cjs/types/hems-one-data-bus-command.cjs +9 -0
- package/dist/cjs/types/hems-one-data-bus-command.d.cts +34 -0
- package/dist/cjs/types/hems-one-data-bus-value.cjs +78 -0
- package/dist/cjs/types/hems-one-data-bus-value.d.cts +379 -0
- package/dist/cjs/types/hems-one-electricity-prices.cjs +2 -0
- package/dist/cjs/types/hems-one-electricity-prices.d.cts +63 -0
- package/dist/cjs/types/hems-one-energy-tariff.cjs +2 -0
- package/dist/cjs/types/hems-one-energy-tariff.d.cts +70 -0
- package/dist/cjs/types/hems-one-heatpump-appliance.cjs +19 -0
- package/dist/cjs/types/hems-one-heatpump-appliance.d.cts +34 -0
- package/dist/cjs/types/hems-one-inverter-appliance.cjs +2 -0
- package/dist/cjs/types/hems-one-inverter-appliance.d.cts +3 -0
- package/dist/cjs/types/hems-one-meter-appliance.cjs +10 -0
- package/dist/cjs/types/hems-one-meter-appliance.d.cts +10 -0
- package/dist/cjs/types/hems-one-network-device.cjs +2 -0
- package/dist/cjs/types/hems-one-network-device.d.cts +31 -0
- package/dist/cjs/types/hems-one-source.enum.cjs +8 -0
- package/dist/cjs/types/hems-one-source.enum.d.cts +4 -0
- package/dist/cjs/types/hems-one-vehicle.cjs +2 -0
- package/dist/cjs/types/hems-one-vehicle.d.cts +12 -0
- package/dist/cjs/types/hems-one-websocket-connection.cjs +2 -0
- package/dist/cjs/types/hems-one-websocket-connection.d.cts +8 -0
- package/dist/cjs/version.cjs +19 -0
- package/dist/cjs/version.d.cts +13 -0
- package/dist/connect-ems-api.d.ts +30 -0
- package/dist/connect-ems-api.js +1 -0
- package/dist/connect-ems-permission.enum.d.ts +3 -0
- package/dist/connect-ems-permission.enum.js +4 -0
- package/dist/connect-ems-permission.type.d.ts +1 -0
- package/dist/connect-ems-permission.type.js +1 -0
- package/dist/connect-package-definition.d.ts +57 -0
- package/dist/connect-package-definition.js +10 -0
- package/dist/energy-app-appliance-type.enum.d.ts +10 -0
- package/dist/energy-app-appliance-type.enum.js +11 -0
- package/dist/energy-app-package-configuration.d.ts +30 -0
- package/dist/energy-app-package-configuration.js +1 -0
- package/dist/energy-app-package-definition.d.ts +123 -0
- package/dist/energy-app-package-definition.js +26 -0
- package/dist/energy-app-permission.type.d.ts +18 -0
- package/dist/energy-app-permission.type.js +18 -0
- package/dist/enyo-energy-app-sdk.d.ts +67 -0
- package/dist/enyo-energy-app-sdk.js +9 -0
- package/dist/hems-one-energy-app-sdk.d.ts +67 -0
- package/dist/hems-one-energy-app-sdk.js +9 -0
- package/dist/implementations/modbus/EnergyAppModbusBattery.d.ts +59 -0
- package/dist/implementations/modbus/EnergyAppModbusBattery.js +384 -0
- package/dist/implementations/modbus/EnergyAppModbusConnectionHealth.d.ts +15 -0
- package/dist/implementations/modbus/EnergyAppModbusConnectionHealth.js +33 -0
- package/dist/implementations/modbus/EnergyAppModbusDataTypeConverter.d.ts +41 -0
- package/dist/implementations/modbus/EnergyAppModbusDataTypeConverter.js +126 -0
- package/dist/implementations/modbus/EnergyAppModbusFaultTolerantReader.d.ts +10 -0
- package/dist/implementations/modbus/EnergyAppModbusFaultTolerantReader.js +45 -0
- package/dist/implementations/modbus/EnergyAppModbusInverter.d.ts +56 -0
- package/dist/implementations/modbus/EnergyAppModbusInverter.js +344 -0
- package/dist/implementations/modbus/EnergyAppModbusMeter.d.ts +26 -0
- package/dist/implementations/modbus/EnergyAppModbusMeter.js +195 -0
- package/dist/implementations/modbus/EnergyAppModbusRegisterMapper.d.ts +13 -0
- package/dist/implementations/modbus/EnergyAppModbusRegisterMapper.js +94 -0
- package/dist/implementations/modbus/interfaces.d.ts +202 -0
- package/dist/implementations/modbus/interfaces.js +23 -0
- package/dist/implementations/ocpp/ocpp-common.d.ts +75 -0
- package/dist/implementations/ocpp/ocpp-common.js +328 -0
- package/dist/implementations/ocpp/ocpp16.d.ts +137 -0
- package/dist/implementations/ocpp/ocpp16.js +48 -0
- package/dist/implementations/ocpp/ocpp201.d.ts +215 -0
- package/dist/implementations/ocpp/ocpp201.js +81 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +99 -0
- package/dist/mockConnectEmsApi.d.ts +10 -0
- package/dist/mockConnectEmsApi.js +160 -0
- package/dist/packages/connect-appliance.d.ts +24 -0
- package/dist/packages/connect-appliance.js +1 -0
- package/dist/packages/connect-http-api.d.ts +15 -0
- package/dist/packages/connect-http-api.js +1 -0
- package/dist/packages/connect-interval.d.ts +15 -0
- package/dist/packages/connect-interval.js +1 -0
- package/dist/packages/connect-modbus.d.ts +60 -0
- package/dist/packages/connect-modbus.js +1 -0
- package/dist/packages/connect-network-devices.d.ts +40 -0
- package/dist/packages/connect-network-devices.js +1 -0
- package/dist/packages/connect-storage.d.ts +14 -0
- package/dist/packages/connect-storage.js +1 -0
- package/dist/packages/energy-app-appliance.d.ts +17 -0
- package/dist/packages/energy-app-appliance.js +1 -0
- package/dist/packages/energy-app-authentication.d.ts +52 -0
- package/dist/packages/energy-app-authentication.js +1 -0
- package/dist/packages/energy-app-charge.d.ts +13 -0
- package/dist/packages/energy-app-charge.js +1 -0
- package/dist/packages/energy-app-charging-card.d.ts +11 -0
- package/dist/packages/energy-app-charging-card.js +1 -0
- package/dist/packages/energy-app-data-bus.d.ts +12 -0
- package/dist/packages/energy-app-data-bus.js +1 -0
- package/dist/packages/energy-app-electricity-prices.d.ts +59 -0
- package/dist/packages/energy-app-electricity-prices.js +1 -0
- package/dist/packages/energy-app-interval.d.ts +15 -0
- package/dist/packages/energy-app-interval.js +1 -0
- package/dist/packages/energy-app-modbus.d.ts +46 -0
- package/dist/packages/energy-app-modbus.js +1 -0
- package/dist/packages/energy-app-network-device.d.ts +25 -0
- package/dist/packages/energy-app-network-device.js +1 -0
- package/dist/packages/energy-app-notification.d.ts +50 -0
- package/dist/packages/energy-app-notification.js +1 -0
- package/dist/packages/energy-app-ocpp.d.ts +52 -0
- package/dist/packages/energy-app-ocpp.js +13 -0
- package/dist/packages/energy-app-settings.d.ts +47 -0
- package/dist/packages/energy-app-settings.js +1 -0
- package/dist/packages/energy-app-storage.d.ts +14 -0
- package/dist/packages/energy-app-storage.js +1 -0
- package/dist/packages/energy-app-vehicle.d.ts +11 -0
- package/dist/packages/energy-app-vehicle.js +1 -0
- package/dist/permission-not-granted.d.ts +8 -0
- package/dist/permission-not-granted.js +14 -0
- package/dist/types/connect-appliance-type.enum.d.ts +6 -0
- package/dist/types/connect-appliance-type.enum.js +7 -0
- package/dist/types/energy-app-settings.d.ts +74 -0
- package/dist/types/energy-app-settings.js +1 -0
- package/dist/types/enyo-appliance.d.ts +81 -0
- package/dist/types/enyo-appliance.js +30 -0
- package/dist/types/enyo-authentication.d.ts +69 -0
- package/dist/types/enyo-authentication.js +6 -0
- package/dist/types/enyo-battery-appliance.d.ts +6 -0
- package/dist/types/enyo-battery-appliance.js +1 -0
- package/dist/types/enyo-charge.d.ts +82 -0
- package/dist/types/enyo-charge.js +12 -0
- package/dist/types/enyo-charger-appliance.d.ts +49 -0
- package/dist/types/enyo-charger-appliance.js +38 -0
- package/dist/types/enyo-charging-card.d.ts +11 -0
- package/dist/types/enyo-charging-card.js +1 -0
- package/dist/types/enyo-data-bus-value.d.ts +379 -0
- package/dist/types/enyo-data-bus-value.js +75 -0
- package/dist/types/enyo-electricity-prices.d.ts +63 -0
- package/dist/types/enyo-electricity-prices.js +1 -0
- package/dist/types/enyo-energy-tariff.d.ts +70 -0
- package/dist/types/enyo-energy-tariff.js +1 -0
- package/dist/types/enyo-heatpump-appliance.d.ts +34 -0
- package/dist/types/enyo-heatpump-appliance.js +16 -0
- package/dist/types/enyo-inverter-appliance.d.ts +3 -0
- package/dist/types/enyo-inverter-appliance.js +1 -0
- package/dist/types/enyo-meter-appliance.d.ts +10 -0
- package/dist/types/enyo-meter-appliance.js +7 -0
- package/dist/types/enyo-network-device.d.ts +31 -0
- package/dist/types/enyo-network-device.js +1 -0
- package/dist/types/enyo-notification.d.ts +48 -0
- package/dist/types/enyo-notification.js +1 -0
- package/dist/types/enyo-settings.d.ts +74 -0
- package/dist/types/enyo-settings.js +1 -0
- package/dist/types/enyo-source.enum.d.ts +4 -0
- package/dist/types/enyo-source.enum.js +5 -0
- package/dist/types/enyo-vehicle.d.ts +12 -0
- package/dist/types/enyo-vehicle.js +1 -0
- package/dist/types/enyo-websocket-connection.d.ts +8 -0
- package/dist/types/enyo-websocket-connection.js +1 -0
- package/dist/types/hems-one-appliance.d.ts +81 -0
- package/dist/types/hems-one-appliance.js +30 -0
- package/dist/types/hems-one-authentication.d.ts +69 -0
- package/dist/types/hems-one-authentication.js +6 -0
- package/dist/types/hems-one-battery-appliance.d.ts +6 -0
- package/dist/types/hems-one-battery-appliance.js +1 -0
- package/dist/types/hems-one-charge.d.ts +82 -0
- package/dist/types/hems-one-charge.js +12 -0
- package/dist/types/hems-one-charger-appliance.d.ts +49 -0
- package/dist/types/hems-one-charger-appliance.js +38 -0
- package/dist/types/hems-one-charging-card.d.ts +11 -0
- package/dist/types/hems-one-charging-card.js +1 -0
- package/dist/types/hems-one-data-bus-command.d.ts +34 -0
- package/dist/types/hems-one-data-bus-command.js +6 -0
- package/dist/types/hems-one-data-bus-value.d.ts +379 -0
- package/dist/types/hems-one-data-bus-value.js +75 -0
- package/dist/types/hems-one-electricity-prices.d.ts +63 -0
- package/dist/types/hems-one-electricity-prices.js +1 -0
- package/dist/types/hems-one-energy-tariff.d.ts +70 -0
- package/dist/types/hems-one-energy-tariff.js +1 -0
- package/dist/types/hems-one-heatpump-appliance.d.ts +34 -0
- package/dist/types/hems-one-heatpump-appliance.js +16 -0
- package/dist/types/hems-one-inverter-appliance.d.ts +3 -0
- package/dist/types/hems-one-inverter-appliance.js +1 -0
- package/dist/types/hems-one-meter-appliance.d.ts +10 -0
- package/dist/types/hems-one-meter-appliance.js +7 -0
- package/dist/types/hems-one-network-device.d.ts +31 -0
- package/dist/types/hems-one-network-device.js +1 -0
- package/dist/types/hems-one-source.enum.d.ts +4 -0
- package/dist/types/hems-one-source.enum.js +5 -0
- package/dist/types/hems-one-vehicle.d.ts +12 -0
- package/dist/types/hems-one-vehicle.js +1 -0
- package/dist/types/hems-one-websocket-connection.d.ts +8 -0
- package/dist/types/hems-one-websocket-connection.js +1 -0
- package/dist/version.d.ts +13 -0
- package/dist/version.js +15 -0
- package/package.json +43 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ConnectApplianceTypeEnum } from "../types/connect-appliance-type.enum.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Represents an appliance managed by the Connect EMS system.
|
|
4
|
+
*/
|
|
5
|
+
export interface ConnectAppliance {
|
|
6
|
+
/** Unique identifier for the appliance */
|
|
7
|
+
id: string;
|
|
8
|
+
/** Type/category of the appliance */
|
|
9
|
+
type: ConnectApplianceTypeEnum;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Interface for managing appliances in Connect EMS packages.
|
|
13
|
+
* Provides CRUD operations for appliance registration and management.
|
|
14
|
+
*/
|
|
15
|
+
export interface ConnectAppliances {
|
|
16
|
+
/** Save or update an appliance in the system */
|
|
17
|
+
save: (appliance: ConnectAppliance) => Promise<void>;
|
|
18
|
+
/** Get a list of all registered appliances */
|
|
19
|
+
list: () => Promise<ConnectAppliance[]>;
|
|
20
|
+
/** Get a specific appliance by its ID */
|
|
21
|
+
getById: (id: string) => Promise<ConnectAppliance | null>;
|
|
22
|
+
/** Remove an appliance by its ID */
|
|
23
|
+
removeById: (id: string) => Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ConnectHttpApi {
|
|
2
|
+
isPermitted: () => boolean;
|
|
3
|
+
get: <T, ERR>(url: string, options?: ConnectHttpApiOptions) => Promise<ConnectHttpApiResponse<T, ERR>>;
|
|
4
|
+
post: <T, ERR>(url: string, body?: any, options?: ConnectHttpApiOptions) => Promise<ConnectHttpApiResponse<T, ERR>>;
|
|
5
|
+
put: <T, ERR>(url: string, body?: any, options?: ConnectHttpApiOptions) => Promise<ConnectHttpApiResponse<T, ERR>>;
|
|
6
|
+
patch: <T, ERR>(url: string, body?: any, options?: ConnectHttpApiOptions) => Promise<ConnectHttpApiResponse<T, ERR>>;
|
|
7
|
+
delete: <T, ERR>(url: string, options?: ConnectHttpApiOptions) => Promise<ConnectHttpApiResponse<T, ERR>>;
|
|
8
|
+
}
|
|
9
|
+
export interface ConnectHttpApiResponse<T, ERR> {
|
|
10
|
+
status: number;
|
|
11
|
+
data: T | ERR;
|
|
12
|
+
}
|
|
13
|
+
export interface ConnectHttpApiOptions {
|
|
14
|
+
headers?: Record<string, string>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported interval durations for scheduled tasks.
|
|
3
|
+
* Provides predefined time intervals from 1 second to 1 hour.
|
|
4
|
+
*/
|
|
5
|
+
export type IntervalDuration = '1s' | '10s' | '30s' | '1m' | '5m' | '1hr';
|
|
6
|
+
/**
|
|
7
|
+
* Interface for managing scheduled intervals in Connect EMS packages.
|
|
8
|
+
* Provides functionality to create and manage recurring tasks.
|
|
9
|
+
*/
|
|
10
|
+
export interface ConnectInterval {
|
|
11
|
+
/** Create a new interval that executes the callback at the specified duration */
|
|
12
|
+
createInterval: (duration: IntervalDuration, callback: () => void) => string;
|
|
13
|
+
/** Stop an existing interval by its ID */
|
|
14
|
+
stopInterval: (intervalId: string) => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration options for establishing a Modbus connection.
|
|
3
|
+
*/
|
|
4
|
+
export interface ModbusOptions {
|
|
5
|
+
/** Hostname or IP address of the Modbus server */
|
|
6
|
+
host: string;
|
|
7
|
+
/** Port number for the Modbus connection (default: 502) */
|
|
8
|
+
port?: number;
|
|
9
|
+
/** Connection timeout in milliseconds */
|
|
10
|
+
timeout?: number;
|
|
11
|
+
/** Modbus unit identifier for the target device */
|
|
12
|
+
unitId?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Data structure for Modbus register operations.
|
|
16
|
+
*/
|
|
17
|
+
export interface ModbusRegisterData {
|
|
18
|
+
/** Register address */
|
|
19
|
+
address: number;
|
|
20
|
+
/** Register value(s) - single number or array for multiple registers */
|
|
21
|
+
value: number | number[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Data structure for Modbus coil operations.
|
|
25
|
+
*/
|
|
26
|
+
export interface ModbusCoilData {
|
|
27
|
+
/** Coil address */
|
|
28
|
+
address: number;
|
|
29
|
+
/** Coil value(s) - single boolean or array for multiple coils */
|
|
30
|
+
value: boolean | boolean[];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Interface for Modbus TCP/IP communication in Connect EMS packages.
|
|
34
|
+
* Provides comprehensive Modbus client functionality for reading and writing
|
|
35
|
+
* coils, discrete inputs, holding registers, and input registers.
|
|
36
|
+
*/
|
|
37
|
+
export interface ConnectModbus {
|
|
38
|
+
/** Establish connection to a Modbus server */
|
|
39
|
+
connect: (options: ModbusOptions) => Promise<void>;
|
|
40
|
+
/** Close the Modbus connection */
|
|
41
|
+
disconnect: () => Promise<void>;
|
|
42
|
+
/** Check if currently connected to a Modbus server */
|
|
43
|
+
isConnected: () => boolean;
|
|
44
|
+
/** Read coil values from the specified address range */
|
|
45
|
+
readCoils: (address: number, quantity: number) => Promise<boolean[]>;
|
|
46
|
+
/** Read discrete input values from the specified address range */
|
|
47
|
+
readDiscreteInputs: (address: number, quantity: number) => Promise<boolean[]>;
|
|
48
|
+
/** Read holding register values from the specified address range */
|
|
49
|
+
readHoldingRegisters: (address: number, quantity: number) => Promise<number[]>;
|
|
50
|
+
/** Read input register values from the specified address range */
|
|
51
|
+
readInputRegisters: (address: number, quantity: number) => Promise<number[]>;
|
|
52
|
+
/** Write a single coil value to the specified address */
|
|
53
|
+
writeSingleCoil: (address: number, value: boolean) => Promise<void>;
|
|
54
|
+
/** Write a single register value to the specified address */
|
|
55
|
+
writeSingleRegister: (address: number, value: number) => Promise<void>;
|
|
56
|
+
/** Write multiple coil values starting from the specified address */
|
|
57
|
+
writeMultipleCoils: (address: number, values: boolean[]) => Promise<void>;
|
|
58
|
+
/** Write multiple register values starting from the specified address */
|
|
59
|
+
writeMultipleRegisters: (address: number, values: number[]) => Promise<void>;
|
|
60
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a detected network device with its connectivity information.
|
|
3
|
+
*/
|
|
4
|
+
export interface NetworkDevice {
|
|
5
|
+
/** Unique identifier for the device */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Network hostname of the device */
|
|
8
|
+
hostname: string;
|
|
9
|
+
/** IP address of the device */
|
|
10
|
+
ipAddress: string;
|
|
11
|
+
/** MAC address of the device (if available) */
|
|
12
|
+
macAddress?: string;
|
|
13
|
+
/** Whether the device is currently online */
|
|
14
|
+
isOnline: boolean;
|
|
15
|
+
/** Timestamp when the device was last seen */
|
|
16
|
+
lastSeen: Date;
|
|
17
|
+
/** List of open network ports on the device */
|
|
18
|
+
ports?: NetworkPort[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Represents an open network port on a device.
|
|
22
|
+
*/
|
|
23
|
+
export interface NetworkPort {
|
|
24
|
+
/** Port number */
|
|
25
|
+
port: number;
|
|
26
|
+
/** Service name running on the port (if detected) */
|
|
27
|
+
service?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Interface for network device discovery and management in Connect EMS packages.
|
|
31
|
+
* Provides functionality to detect and interact with devices on the local network.
|
|
32
|
+
*/
|
|
33
|
+
export interface ConnectNetworkDevices {
|
|
34
|
+
/** Get list of all previously detected network devices */
|
|
35
|
+
getDetectedDevices: () => Promise<NetworkDevice[]>;
|
|
36
|
+
/** Get a specific device by its unique ID */
|
|
37
|
+
getDevice: (deviceId: string) => Promise<NetworkDevice | null>;
|
|
38
|
+
/** Trigger an asynchronous search for new devices on the network */
|
|
39
|
+
searchDevices: () => Promise<NetworkDevice[]>;
|
|
40
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for persistent storage operations in Connect EMS packages.
|
|
3
|
+
* Provides key-value storage capabilities for package data persistence.
|
|
4
|
+
*/
|
|
5
|
+
export interface ConnectStorage {
|
|
6
|
+
/** Save an object to storage with the specified key */
|
|
7
|
+
save: (key: string, value: object) => Promise<void>;
|
|
8
|
+
/** Load an object from storage by key, returns null if not found */
|
|
9
|
+
load: (key: string) => Promise<object | null>;
|
|
10
|
+
/** Remove an object from storage by key */
|
|
11
|
+
remove: (key: string) => Promise<void>;
|
|
12
|
+
/** Returns a list of all keys stored in the storage */
|
|
13
|
+
listKeys: () => Promise<string[]>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EnyoAppliance } from "../types/enyo-appliance.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for managing appliances in enyo packages.
|
|
4
|
+
* Provides CRUD operations for appliance registration and management.
|
|
5
|
+
*/
|
|
6
|
+
export interface EnergyAppAppliance {
|
|
7
|
+
/** Save or update an appliance in the system */
|
|
8
|
+
save: (appliance: Omit<EnyoAppliance, 'id'>, applianceId: string | undefined) => Promise<string>;
|
|
9
|
+
/** Get a list of all registered appliances of your package */
|
|
10
|
+
list: () => Promise<EnyoAppliance[]>;
|
|
11
|
+
/** Get a list of all appliances. Needs a specific permission */
|
|
12
|
+
listAll: () => Promise<EnyoAppliance[]>;
|
|
13
|
+
/** Get a specific appliance by its ID */
|
|
14
|
+
getById: (id: string) => Promise<EnyoAppliance | null>;
|
|
15
|
+
/** Remove an appliance by its ID */
|
|
16
|
+
removeById: (id: string) => Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { EnyoAuthenticateState, EnyoAuthentication, EnyoAuthenticationResponse, EnyoOauthAuthenticationParameters, EnyoOauthAuthenticationRedirectUrlResponse } from "../types/enyo-authentication.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for requesting user authentication for appliances or the entire package.
|
|
4
|
+
* Provides methods to handle authentication requests, listen for responses, and manage authentication state.
|
|
5
|
+
*/
|
|
6
|
+
export interface EnergyAppAuthentication {
|
|
7
|
+
/**
|
|
8
|
+
* Requests user authentication for an appliance or the entire package.
|
|
9
|
+
* The user will receive a notification to authenticate. This operation might take time.
|
|
10
|
+
*
|
|
11
|
+
* @param authentication - The authentication configuration containing type, credentials setup, and optional appliance ID
|
|
12
|
+
* @returns Promise that resolves to the request ID for tracking the authentication process
|
|
13
|
+
*/
|
|
14
|
+
requestAuthentication(authentication: EnyoAuthentication): Promise<string>;
|
|
15
|
+
/**
|
|
16
|
+
* If you use oauth with clientIdName and clientSecretName, you need to listen to this and respond with the redirect url
|
|
17
|
+
*/
|
|
18
|
+
listenForOauthParameters(listener: (response: EnyoOauthAuthenticationParameters) => Promise<EnyoOauthAuthenticationRedirectUrlResponse>): string;
|
|
19
|
+
/**
|
|
20
|
+
* Adds a listener for authentication responses.
|
|
21
|
+
* The listener will be called when the user completes the authentication process.
|
|
22
|
+
*
|
|
23
|
+
* @param listener - Callback function that receives the authentication response and should return the authentication state
|
|
24
|
+
* @returns The listener ID for removing the listener later
|
|
25
|
+
*/
|
|
26
|
+
listenForAuthenticationResponse(listener: (response: EnyoAuthenticationResponse) => Promise<EnyoAuthenticateState>): string;
|
|
27
|
+
/**
|
|
28
|
+
* Removes a previously registered authentication response listener.
|
|
29
|
+
*
|
|
30
|
+
* @param listenerId - The ID of the listener to remove
|
|
31
|
+
*/
|
|
32
|
+
removeListener: (listenerId: string) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Adds a listener for user-initiated sign-out events.
|
|
35
|
+
* The listener will be called when the user manually signs out.
|
|
36
|
+
*
|
|
37
|
+
* @param listener - Callback function called when user signs out
|
|
38
|
+
* @returns The listener ID for removing the listener later
|
|
39
|
+
*/
|
|
40
|
+
listenForSignOut(listener: () => void): string;
|
|
41
|
+
/**
|
|
42
|
+
* Gets the current authentication state.
|
|
43
|
+
*
|
|
44
|
+
* @returns Promise that resolves to the current authentication state
|
|
45
|
+
*/
|
|
46
|
+
getAuthenticationState(): Promise<EnyoAuthenticateState>;
|
|
47
|
+
/**
|
|
48
|
+
* Signs the user out and updates the authentication state.
|
|
49
|
+
* This will trigger any registered sign-out listeners.
|
|
50
|
+
*/
|
|
51
|
+
signOut(): void;
|
|
52
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EnyoCharge, EnyoChargeFilter } from "../types/enyo-charge.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for managing charging sessions in enyo packages.
|
|
4
|
+
* Provides operations for charge session tracking and management.
|
|
5
|
+
*/
|
|
6
|
+
export interface EnergyAppCharge {
|
|
7
|
+
/** Save or update a charging session in the system */
|
|
8
|
+
save: (charge: Omit<EnyoCharge, 'id'>, chargeId?: string) => Promise<void>;
|
|
9
|
+
/** Get a list of charging sessions with optional filtering */
|
|
10
|
+
list: (filter?: EnyoChargeFilter) => Promise<EnyoCharge[]>;
|
|
11
|
+
/** Get a specific charging session by its ID */
|
|
12
|
+
getById: (id: string) => Promise<EnyoCharge | null>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EnyoChargingCard } from "../types/enyo-charging-card.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for managing charging cards in enyo packages.
|
|
4
|
+
* Provides read-only operations for charging card information.
|
|
5
|
+
*/
|
|
6
|
+
export interface EnergyAppChargingCard {
|
|
7
|
+
/** Get a list of all registered charging cards */
|
|
8
|
+
list: () => Promise<EnyoChargingCard[]>;
|
|
9
|
+
/** Get a specific charging card by its ID */
|
|
10
|
+
getById: (id: string) => Promise<EnyoChargingCard | null>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EnyoDataBusMessage, EnyoDataBusMessageAnswer, EnyoDataBusMessageEnum } from "../types/enyo-data-bus-value.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for interaction with the Data Bus to send data or listen for changes
|
|
4
|
+
*/
|
|
5
|
+
export interface EnergyAppDataBus {
|
|
6
|
+
sendMessage: (messages: EnyoDataBusMessage[], options?: EnergyAppDataBusSendDataOptions) => void;
|
|
7
|
+
sendAnswer: (answer: EnyoDataBusMessageAnswer, options?: EnergyAppDataBusSendDataOptions) => void;
|
|
8
|
+
listenForMessages: (types: EnyoDataBusMessageEnum[], listener: (entry: EnyoDataBusMessage) => void) => string;
|
|
9
|
+
unsubscribe: (listenerId: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface EnergyAppDataBusSendDataOptions {
|
|
12
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ElectricityPriceRequest, ElectricityPriceResponse, ElectricityPriceUpdate } from "../types/enyo-electricity-prices.cjs";
|
|
2
|
+
import { EnergyTariffInfo } from "../types/enyo-energy-tariff.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* Interface for retrieving electricity price information.
|
|
5
|
+
* Provides methods to get current and forecast electricity prices,
|
|
6
|
+
* always normalized to 15-minute intervals regardless of source data resolution.
|
|
7
|
+
*/
|
|
8
|
+
export interface EnergyAppElectricityPrices {
|
|
9
|
+
/**
|
|
10
|
+
* Retrieves electricity prices for a specified time range.
|
|
11
|
+
* The response always contains prices in 15-minute intervals,
|
|
12
|
+
* interpolated from the original data source (constant, 15min, or 1hr intervals).
|
|
13
|
+
*
|
|
14
|
+
* @param request - The price request parameters including time range and optional appliance ID
|
|
15
|
+
* @returns Promise that resolves to electricity prices for the requested time range
|
|
16
|
+
*/
|
|
17
|
+
getPrices(request: ElectricityPriceRequest): Promise<ElectricityPriceResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Retrieves the current active tariff information.
|
|
20
|
+
* This includes tariff metadata, provider information, and pricing structure details.
|
|
21
|
+
*
|
|
22
|
+
* @param applianceId - Optional appliance ID to get appliance-specific tariff. If omitted, returns system-wide tariff
|
|
23
|
+
* @returns Promise that resolves to current tariff information, or null if no tariff is configured
|
|
24
|
+
*/
|
|
25
|
+
getCurrentTariff(applianceId?: string): Promise<EnergyTariffInfo | null>;
|
|
26
|
+
/**
|
|
27
|
+
* Registers a listener for real-time electricity price updates.
|
|
28
|
+
* The listener will be called when tariffs change, prices are updated, or new forecasts become available.
|
|
29
|
+
*
|
|
30
|
+
* @param listener - Callback function that will be called when price updates occur
|
|
31
|
+
* @returns Listener ID that can be used to remove the listener later
|
|
32
|
+
*/
|
|
33
|
+
listenForPriceUpdates(listener: (update: ElectricityPriceUpdate) => void): string;
|
|
34
|
+
/**
|
|
35
|
+
* Removes a previously registered price update listener.
|
|
36
|
+
*
|
|
37
|
+
* @param listenerId - The ID of the listener to remove
|
|
38
|
+
*/
|
|
39
|
+
removeListener(listenerId: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves the current electricity price for the current 15-minute interval.
|
|
42
|
+
* This is a convenience method that gets the price for "now".
|
|
43
|
+
*
|
|
44
|
+
* @param applianceId - Optional appliance ID to get appliance-specific pricing
|
|
45
|
+
* @returns Promise that resolves to current price information, or null if no pricing data is available
|
|
46
|
+
*/
|
|
47
|
+
getCurrentPrice(applianceId?: string): Promise<ElectricityPriceEntry | null>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Represents a single electricity price entry for convenience methods
|
|
51
|
+
*/
|
|
52
|
+
export interface ElectricityPriceEntry {
|
|
53
|
+
/** Start time of this 15-minute interval in ISO format */
|
|
54
|
+
timestampIso: string;
|
|
55
|
+
/** Price per kWh for electricity consumption during this interval */
|
|
56
|
+
consumptionPricePerKwh: number;
|
|
57
|
+
/** Optional price per kWh for grid feed-in during this interval */
|
|
58
|
+
feedInPricePerKwh?: number;
|
|
59
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported interval durations for scheduled tasks.
|
|
3
|
+
* Provides predefined time intervals from 1 second to 1 hour.
|
|
4
|
+
*/
|
|
5
|
+
export type IntervalDuration = '10s' | '30s' | '1m' | '5m' | '1hr';
|
|
6
|
+
/**
|
|
7
|
+
* Interface for managing scheduled intervals in enyo packages.
|
|
8
|
+
* Provides functionality to create and manage recurring tasks.
|
|
9
|
+
*/
|
|
10
|
+
export interface EnergyAppInterval {
|
|
11
|
+
/** Create a new interval that executes the callback at the specified duration */
|
|
12
|
+
createInterval: (duration: IntervalDuration, callback: (clockId: string) => void) => string;
|
|
13
|
+
/** Stop an existing interval by its ID */
|
|
14
|
+
stopInterval: (intervalId: string) => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration options for establishing a Modbus connection.
|
|
3
|
+
*/
|
|
4
|
+
export interface ModbusOptions {
|
|
5
|
+
/** Hostname or IP address of the Modbus server */
|
|
6
|
+
host: string;
|
|
7
|
+
/** Port number for the Modbus connection (default: 502) */
|
|
8
|
+
port?: number;
|
|
9
|
+
/** Connection timeout in milliseconds */
|
|
10
|
+
timeout?: number;
|
|
11
|
+
/** Modbus unit identifier for the target device */
|
|
12
|
+
unitId?: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Interface for Modbus TCP/IP communication in enyo packages.
|
|
16
|
+
* Provides comprehensive Modbus client functionality for reading and writing
|
|
17
|
+
* coils, discrete inputs, holding registers, and input registers.
|
|
18
|
+
*/
|
|
19
|
+
export interface EnergyAppModbus {
|
|
20
|
+
/** Establish connection to a Modbus server */
|
|
21
|
+
connect: (options: ModbusOptions) => Promise<EnergyAppModbusInstance>;
|
|
22
|
+
}
|
|
23
|
+
export interface EnergyAppModbusInstance {
|
|
24
|
+
/** Close the Modbus connection */
|
|
25
|
+
disconnect: () => Promise<void>;
|
|
26
|
+
/** Check if currently connected to a Modbus server */
|
|
27
|
+
isConnected: () => boolean;
|
|
28
|
+
/** Read coil values from the specified address range */
|
|
29
|
+
readCoils: (address: number, quantity: number) => Promise<boolean[]>;
|
|
30
|
+
/** Read discrete input values from the specified address range */
|
|
31
|
+
readDiscreteInputs: (address: number, quantity: number) => Promise<boolean[]>;
|
|
32
|
+
/** Read holding register values from the specified address range */
|
|
33
|
+
readHoldingRegisters: (address: number, quantity: number) => Promise<Buffer>;
|
|
34
|
+
/** Read input register values from the specified address range */
|
|
35
|
+
readInputRegisters: (address: number, quantity: number) => Promise<Buffer>;
|
|
36
|
+
/** Write a single coil value to the specified address */
|
|
37
|
+
writeSingleCoil: (address: number, value: boolean) => Promise<void>;
|
|
38
|
+
/** Write a single register value to the specified address */
|
|
39
|
+
writeSingleRegister: (address: number, value: number) => Promise<void>;
|
|
40
|
+
/** Write multiple coil values starting from the specified address */
|
|
41
|
+
writeMultipleCoils: (address: number, values: boolean[]) => Promise<void>;
|
|
42
|
+
/** Write multiple register values starting from the specified address */
|
|
43
|
+
writeMultipleRegisters: (address: number, values: number[]) => Promise<void>;
|
|
44
|
+
/** Read holding register string value */
|
|
45
|
+
readRegisterStringValue: (address: number, quantity: number) => Promise<string>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EnyoNetworkDevice, EnyoNetworkDeviceAccessStatus } from "../types/enyo-network-device.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for network device discovery and management in enyo packages.
|
|
4
|
+
* Provides functionality to detect and interact with devices on the local network.
|
|
5
|
+
*/
|
|
6
|
+
export interface EnergyAppNetworkDevice {
|
|
7
|
+
/** Get list of all previously detected network devices */
|
|
8
|
+
getDevices: (filter?: {
|
|
9
|
+
accessStatus?: EnyoNetworkDeviceAccessStatus;
|
|
10
|
+
}) => Promise<EnyoNetworkDevice[]>;
|
|
11
|
+
/** Get a specific device by its unique ID */
|
|
12
|
+
getDevice: (deviceId: string) => Promise<EnyoNetworkDevice | null>;
|
|
13
|
+
/** Trigger an asynchronous search for new devices on the network */
|
|
14
|
+
searchDevices: () => Promise<EnyoNetworkDevice[]>;
|
|
15
|
+
/** Trigger an async request to the user to accept or reject a network device access request. Ports are optional */
|
|
16
|
+
requestDeviceAccess: (deviceId: string, ports?: number[]) => Promise<{
|
|
17
|
+
status: EnyoNetworkDeviceAccessStatus;
|
|
18
|
+
}>;
|
|
19
|
+
/** listen for device access changes. Returns a listener id */
|
|
20
|
+
listenForDeviceAccessChange: (listener: (deviceId: string, status: EnyoNetworkDeviceAccessStatus) => void) => string;
|
|
21
|
+
/** listen for detected devices, based on the device definition in the energy app package definition */
|
|
22
|
+
listenForDetectedDevice: (listener: (detectedDevices: EnyoNetworkDevice[]) => void) => string;
|
|
23
|
+
/** Removes the listener */
|
|
24
|
+
removeListener: (listenerId: string) => void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { EnyoNotification, EnyoNotificationOptions, EnyoNotificationTranslation, EnyoNotificationType } from "../types/enyo-notification.cjs";
|
|
2
|
+
/**
|
|
3
|
+
* Interface for managing user notifications within Energy App packages.
|
|
4
|
+
* Provides methods to show, retrieve, and manage notifications with multi-language support.
|
|
5
|
+
*/
|
|
6
|
+
export interface EnergyAppNotification {
|
|
7
|
+
/**
|
|
8
|
+
* Shows a notification to the user with multi-language support.
|
|
9
|
+
* The notification will be displayed according to the specified type and options.
|
|
10
|
+
*
|
|
11
|
+
* @param type - The type of notification (info, warning, error, success) determining visual style
|
|
12
|
+
* @param options - Configuration options including permanence, expiration, priority, and appliance association
|
|
13
|
+
* @param translations - Array of translated notification messages for different supported languages
|
|
14
|
+
* @returns Unique notification ID that can be used for tracking and removal
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const notificationId = showNotification('warning',
|
|
19
|
+
* { permanent: true, priority: 'high' },
|
|
20
|
+
* [
|
|
21
|
+
* { language: 'en', notification: 'Battery level is low' },
|
|
22
|
+
* { language: 'de', notification: 'Batteriestand ist niedrig' }
|
|
23
|
+
* ]
|
|
24
|
+
* );
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
showNotification(type: EnyoNotificationType, options: EnyoNotificationOptions, translations: EnyoNotificationTranslation[]): string;
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves all currently active notifications.
|
|
30
|
+
* Returns notifications in chronological order (newest first) unless sorted by priority.
|
|
31
|
+
*
|
|
32
|
+
* @param applianceId - Optional appliance ID to filter notifications for a specific appliance
|
|
33
|
+
* @returns Array of all current notifications with complete metadata
|
|
34
|
+
*/
|
|
35
|
+
getNotifications(applianceId?: string): EnyoNotification[];
|
|
36
|
+
/**
|
|
37
|
+
* Removes a specific notification from the active notification list.
|
|
38
|
+
* If the notification doesn't exist, this method completes silently.
|
|
39
|
+
*
|
|
40
|
+
* @param notificationId - The unique ID of the notification to remove
|
|
41
|
+
*/
|
|
42
|
+
removeNotification(notificationId: string): void;
|
|
43
|
+
/**
|
|
44
|
+
* Removes all active notifications.
|
|
45
|
+
* This is a convenience method for clearing the entire notification queue.
|
|
46
|
+
*
|
|
47
|
+
* @param applianceId - Optional appliance ID to clear only notifications for a specific appliance
|
|
48
|
+
*/
|
|
49
|
+
clearAllNotifications(applianceId?: string): void;
|
|
50
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnyoOcppErrorCode = void 0;
|
|
4
|
+
var EnyoOcppErrorCode;
|
|
5
|
+
(function (EnyoOcppErrorCode) {
|
|
6
|
+
EnyoOcppErrorCode["NotImplemented"] = "NotImplemented";
|
|
7
|
+
EnyoOcppErrorCode["NotSupported"] = "NotSupported";
|
|
8
|
+
EnyoOcppErrorCode["InternalError"] = "InternalError";
|
|
9
|
+
EnyoOcppErrorCode["ProtocolError"] = "ProtocolError";
|
|
10
|
+
EnyoOcppErrorCode["SecurityError"] = "SecurityError";
|
|
11
|
+
EnyoOcppErrorCode["FormationViolation"] = "FormationViolation";
|
|
12
|
+
EnyoOcppErrorCode["PropertyConstraintViolation"] = "PropertyConstraintViolation";
|
|
13
|
+
EnyoOcppErrorCode["OccurenceConstraintViolation"] = "OccurenceConstraintViolation";
|
|
14
|
+
EnyoOcppErrorCode["TypeConstraintViolation"] = "TypeConstraintViolation";
|
|
15
|
+
EnyoOcppErrorCode["GenericError"] = "GenericError";
|
|
16
|
+
})(EnyoOcppErrorCode || (exports.EnyoOcppErrorCode = EnyoOcppErrorCode = {}));
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export interface EnyoOcppAvailableConnectionDetail {
|
|
2
|
+
url: string;
|
|
3
|
+
path: string;
|
|
4
|
+
host: string;
|
|
5
|
+
secure: boolean;
|
|
6
|
+
port: number;
|
|
7
|
+
}
|
|
8
|
+
export interface EnyoOcppAvailableConnectionDetails {
|
|
9
|
+
cloud?: EnyoOcppAvailableConnectionDetail;
|
|
10
|
+
local?: EnyoOcppAvailableConnectionDetail;
|
|
11
|
+
}
|
|
12
|
+
export type EnyoOCPPVersion = '1.6' | '2.0.1';
|
|
13
|
+
export interface EnyoOcppChargePointConnection {
|
|
14
|
+
chargePointId: string;
|
|
15
|
+
remoteAddress?: string;
|
|
16
|
+
protocolVersion: EnyoOCPPVersion;
|
|
17
|
+
}
|
|
18
|
+
export interface EnergyAppOcppMessageContext {
|
|
19
|
+
chargePointId: string;
|
|
20
|
+
messageId: string;
|
|
21
|
+
version: EnyoOCPPVersion;
|
|
22
|
+
timestamp: Date;
|
|
23
|
+
}
|
|
24
|
+
export declare enum EnyoOcppErrorCode {
|
|
25
|
+
NotImplemented = "NotImplemented",
|
|
26
|
+
NotSupported = "NotSupported",
|
|
27
|
+
InternalError = "InternalError",
|
|
28
|
+
ProtocolError = "ProtocolError",
|
|
29
|
+
SecurityError = "SecurityError",
|
|
30
|
+
FormationViolation = "FormationViolation",
|
|
31
|
+
PropertyConstraintViolation = "PropertyConstraintViolation",
|
|
32
|
+
OccurenceConstraintViolation = "OccurenceConstraintViolation",
|
|
33
|
+
TypeConstraintViolation = "TypeConstraintViolation",
|
|
34
|
+
GenericError = "GenericError"
|
|
35
|
+
}
|
|
36
|
+
export interface EnergyAppOcppMessageHandler<TRequest = any, TResponse = any> {
|
|
37
|
+
(request: TRequest, context: EnergyAppOcppMessageContext): Promise<TResponse>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Interface for OCPP functionality in enyo packages.
|
|
41
|
+
*/
|
|
42
|
+
export interface EnergyAppOcpp {
|
|
43
|
+
getAvailableConnectionDetails: () => Promise<EnyoOcppAvailableConnectionDetails>;
|
|
44
|
+
listenForChargePointConnected: (listener: (connection: EnyoOcppChargePointConnection) => void) => string;
|
|
45
|
+
listenForChargePointDisconnected: (listener: (chargePointId: string) => void) => string;
|
|
46
|
+
registerHandler: <TRequest, TResponse>(action: string, handler: EnergyAppOcppMessageHandler<TRequest, TResponse>, version?: EnyoOCPPVersion) => string;
|
|
47
|
+
sendCall: <TRequest, TResponse>(chargePointId: string, message: string, payload: TRequest, messageId?: string) => Promise<TResponse>;
|
|
48
|
+
getConnectedChargePoints: () => EnyoOcppChargePointConnection[];
|
|
49
|
+
getChargePoint: (chargePointId: string) => EnyoOcppChargePointConnection | undefined;
|
|
50
|
+
disconnectChargePoint: (chargePointId: string, reason?: string) => void;
|
|
51
|
+
unsubscribe: (id: string) => void;
|
|
52
|
+
}
|