This repository has been archived by the owner on Sep 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- adjust the mqtt configuration BREAKING CHANGE: - change static/dynamic topic to template topic, which has five template key: `:namespace`, `:name`, `:uid`, `:path` and `:operator`. - move will message configuration item to `message` field, and then don't need to set `qos` and `retained` in will message.
- Loading branch information
1 parent
4bfb6e1
commit bb92675
Showing
57 changed files
with
2,474 additions
and
4,220 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
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 |
---|---|---|
@@ -1,17 +1,10 @@ | ||
package v1alpha1 | ||
|
||
import "github.com/rancher/octopus/pkg/mqtt/api/v1alpha1" | ||
import mqttapi "github.com/rancher/octopus/pkg/mqtt/api" | ||
|
||
// DeviceExtensionSpec defines the desired state of device extension. | ||
type DeviceExtensionSpec struct { | ||
// Specifies the MQTT settings. | ||
// +optional | ||
MQTT *v1alpha1.MQTTOptionsSpec `json:"mqtt,omitempty"` | ||
} | ||
|
||
// DeviceExtensionStatus defines the observed state of device extension. | ||
type DeviceExtensionStatus struct { | ||
// Reports the MQTT settings. | ||
// +optional | ||
MQTT *v1alpha1.MQTTOptionsStatus `json:"mqtt,omitempty"` | ||
MQTT *mqttapi.MQTTOptions `json:"mqtt,omitempty"` | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,59 @@ | ||
apiVersion: edge.cattle.io/v1alpha1 | ||
kind: DeviceLink | ||
metadata: | ||
name: xiaomi-temp-rs2200 | ||
spec: | ||
adaptor: | ||
node: edge-worker | ||
name: adaptors.edge.cattle.io/ble | ||
model: | ||
apiVersion: "devices.edge.cattle.io/v1alpha1" | ||
kind: "BluetoothDevice" | ||
template: | ||
metadata: | ||
labels: | ||
device: xiaomi-temp-rs2200 | ||
spec: | ||
parameters: | ||
syncInterval: 15s | ||
timeout: 10s | ||
protocol: | ||
name: "MJ_HT_V1" | ||
macAddress: "" | ||
properties: | ||
- name: data | ||
description: XiaoMi temp sensor with temperature and humidity data | ||
accessMode: NotifyOnly | ||
visitor: | ||
characteristicUUID: 226c000064764566756266734470666d | ||
- name: humidity | ||
description: Humidity in percent | ||
accessMode: ReadOnly | ||
visitor: | ||
characteristicUUID: f000aa0304514000b000000000000000 | ||
# dataConverter is optional | ||
dataConverter: | ||
startIndex: 1 | ||
endIndex: 0 | ||
shiftRight: 2 | ||
orderOfOperations: | ||
- operationType: Multiply # options are Add/Subtract/Multiply/Divide | ||
operationValue: "0.03125" | ||
- name: power-enabled | ||
description: turn the device power on or off | ||
accessMode: ReadWrite | ||
visitor: | ||
# characteristicUUID, dataWrite and defaultValue is required when accessMode is ReadWrite | ||
characteristicUUID: f000aa0104514000b000000000000001 | ||
defaultValue: OFF # set the defaultValue by chosen one of option in the dataWrite | ||
dataWrite: | ||
ON: [1] | ||
OFF: [0] | ||
# dataConverter is optional | ||
dataConverter: | ||
startIndex: 1 | ||
endIndex: 0 | ||
shiftRight: 3 | ||
orderOfOperations: | ||
- operationType: Multiply | ||
operationValue: "0.03125" |
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
Oops, something went wrong.