-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
export enum SensorType { | ||
Iotawatt = 'iotawatt', | ||
Shelly = 'shelly', | ||
Virtual = 'virtual', | ||
Unmetered = 'unmetered', | ||
Dummy = 'dummy', | ||
} | ||
|
||
export interface PowerSensor { | ||
type: SensorType | ||
} | ||
|
||
export enum CircuitType { | ||
Main = 'main', | ||
Circuit = 'circuit', | ||
} | ||
|
||
export type Circuit = { | ||
name: string | ||
type: CircuitType // resolved during parsing | ||
parent?: Circuit // resolved to the circuit in question | ||
children: Circuit[] // resolved from parent | ||
phase?: string // resolved from parent | ||
hidden?: boolean // defaults to false | ||
sensor: PowerSensor | ||
group?: string | ||
} | ||
|
||
export type PowerSensorData = { | ||
timestamp: number | ||
circuit: Circuit | ||
// Mandatory data. Undefined means the data was not available. | ||
power?: number | ||
// Optional data, not all sensor types support them | ||
apparentPower?: number | ||
powerFactor?: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters