refactor!: Rename "devices" to "hosts" in "exportHistory" - operation. Prepare extraction of device specific types and alignment with integration layer

This commit is contained in:
Andreas Hilbig 2026-01-06 12:42:43 +01:00
parent 92ffe71684
commit 47640ff13e
10 changed files with 11888 additions and 35 deletions

View file

@ -0,0 +1,49 @@
"""
Represents a message containing information about a specific device and its associated data value.
The class is designed to be extended by other classes that define more structured or specialized types
of device value messages.
"""
interface DeviceValueMessage {
"""
A unique identifier used to distinguish a specific device within the system.
This field is commonly used to associate messages, configurations, or data values
with a particular device.
"""
deviceKey: String
"""
Represents the timestamp at which a specific event, message, or data point was created or recorded.
The format should align with standard expectations (e.g., ISO 8601).
"""
timestamp: String
"""
Represents the name assigned to a set of values that are submitted together with a single timestamp.
This name is associated with a well-defined data structure.
"""
attributeName: String
"""
Represents the name of the sub-topic to which the attribute is submitted.
Classification or grouping of data within a broader topic structure.
"""
topicName: String
"""
Specifies the type or category of the device. Used to define the classification
of a device in the system (capabilities, functionalities, or purpose).
"""
deviceType: String
"""
Retrieves the value associated with the current instance of the object.
"""
value: DeviceValue
}
"""
Marker-interface for device-related data values.
"""
interface DeviceValue {
_empty: String
}

View file

@ -0,0 +1,60 @@
"""
Concrete implementation of a DeviceValueMessage for sensor distance data.
"""
type SensorDistanceMessage implements DeviceValueMessage {
deviceKey: String
timestamp: String
attributeName: String
topicName: String
deviceType: String
value: SensorDistanceValue
}
"""
Represents the payload for a sensor distance measurement.
"""
type SensorDistanceValue implements DeviceValue {
"""
Represents the name of the device that reports or provides distance sensor data.
Uniquely identifies the device within the context of the SensorDistanceValue.
"""
deviceName: String
"""
Represents the MAC address of the device. Typically formatted as a 12-character
hexadecimal string (e.g., "00:1A:2B:3C:4D:5E").
"""
mac: String
"""
Represents the measured or calculated distance value, typically in meters.
Should be non-negative.
"""
distance: Float
"""
Represents the time at which the sensor measurement was recorded.
"""
time: String
_empty: String
}
"""
Represents a coordinate in 3D space with x, y, and z components.
"""
type Position {
x: Float
y: Float
z: Float
}
"""
Represents the result of a position calculation, including the calculated position and accuracy.
"""
type PositionCalculatorResult {
position: Position
accuracy: Float
}

View file

@ -0,0 +1,68 @@
"""
DistanceTracker represents a device which can detect other devices around itself and estimate
the distances, e.g. by using Bluetooth scanning technology and estimating the distance by .
Optionally the
"""
type DistanceTrackerDevice implements Host & Device {
hostid: ID!
"""
Per convention a uuid is used as hostname to identify devices if they do not have a unique hostname
"""
host: String!
deviceType: String
hostgroups: [HostGroup!]
name: String
tags: JSONObject
state: DistanceTrackerState
}
type DistanceTrackerState implements DeviceState {
operational: OperationalDeviceData
current: DistanceTrackerCurrentState
}
type DistanceTrackerCurrentState {
values: DistanceTrackerValues
}
type DistanceTrackerValues {
"""
Aggregated information of devices detected around the tracker
"""
countValues: DeviceCountValues
"""
Information about devices detected nearby
"""
distanceValues: String
}
type DeviceCountValues {
"""
Number of unique deviceKeys detected between timeFrom and timeUnti
"""
count: Int
"""
Start of time interval for the delivered device counting value
"""
timeFrom: Time
"""
End of time interval for the delivered device counting value
"""
timeUntil: Time
}
type DeviceDistanceValues {
"""
Number of unique deviceKeys detected between timeFrom and timeUnti
"""
count: Int
"""
Start of time interval for the delivered device counting value
"""
timeFrom: Time
"""
End of time interval for the delivered device counting value
"""
timeUntil: Time
}