Skip to content

Commit 250a5c5

Browse files
committed
add OcaTemperatureSensor
1 parent 4ef45b3 commit 250a5c5

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// Copyright (c) 2025 PADL Software Pty Ltd
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the License);
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an 'AS IS' BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
open class OcaTemperatureSensor: OcaSensor, @unchecked Sendable {
18+
override open class var classID: OcaClassID { OcaClassID("1.1.2.5") }
19+
20+
@OcaProperty(
21+
propertyID: OcaPropertyID("4.1"),
22+
getMethodID: OcaMethodID("4.1")
23+
)
24+
public var reading: OcaProperty<OcaTemperature>.PropertyValue
25+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//
2+
// Copyright (c) 2025 PADL Software Pty Ltd
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the License);
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an 'AS IS' BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
import SwiftOCA
18+
19+
open class OcaTemperatureSensor: OcaSensor {
20+
override open class var classID: OcaClassID { OcaClassID("1.1.2.5") }
21+
22+
@OcaDeviceProperty(
23+
propertyID: OcaPropertyID("4.1"),
24+
getMethodID: OcaMethodID("4.1")
25+
)
26+
public var reading: OcaTemperature = 0.0
27+
}

SwiftOCA.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@
257257
D3E6E29B2A44270300BF7095 /* LevelSensorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E6E29A2A44270300BF7095 /* LevelSensorView.swift */; };
258258
D3E6E29E2A443CF100BF7095 /* SystemToggleStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E6E29D2A443CF100BF7095 /* SystemToggleStyle.swift */; };
259259
D3E6E2A02A452D0A00BF7095 /* ScaledLegendView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E6E29F2A452D0A00BF7095 /* ScaledLegendView.swift */; };
260+
D3E741482D56331F0044CCBB /* TemperatureSensor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E741472D56331F0044CCBB /* TemperatureSensor.swift */; };
261+
D3E7414A2D5633740044CCBB /* TemperatureSensor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3E741492D5633740044CCBB /* TemperatureSensor.swift */; };
260262
D3F2942C2A95D55F00D7F0CD /* Sequence+AsyncMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3F2942B2A95D55F00D7F0CD /* Sequence+AsyncMap.swift */; };
261263
D3FAC8DE2B5CF25D009E2775 /* FirmwareManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3FAC8DD2B5CF25D009E2775 /* FirmwareManager.swift */; };
262264
D3FAC8E02B5CF2F6009E2775 /* FirmwareManagerDataTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = D3FAC8DF2B5CF2F6009E2775 /* FirmwareManagerDataTypes.swift */; };
@@ -566,6 +568,8 @@
566568
D3E6E29A2A44270300BF7095 /* LevelSensorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = LevelSensorView.swift; path = Sources/SwiftOCAUI/Views/Workers/Sensors/LevelSensorView.swift; sourceTree = SOURCE_ROOT; };
567569
D3E6E29D2A443CF100BF7095 /* SystemToggleStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemToggleStyle.swift; sourceTree = "<group>"; };
568570
D3E6E29F2A452D0A00BF7095 /* ScaledLegendView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScaledLegendView.swift; sourceTree = "<group>"; };
571+
D3E741472D56331F0044CCBB /* TemperatureSensor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TemperatureSensor.swift; sourceTree = "<group>"; };
572+
D3E741492D5633740044CCBB /* TemperatureSensor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TemperatureSensor.swift; sourceTree = "<group>"; };
569573
D3F2942B2A95D55F00D7F0CD /* Sequence+AsyncMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Sequence+AsyncMap.swift"; sourceTree = "<group>"; };
570574
D3FAC8DD2B5CF25D009E2775 /* FirmwareManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirmwareManager.swift; sourceTree = "<group>"; };
571575
D3FAC8DF2B5CF2F6009E2775 /* FirmwareManagerDataTypes.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FirmwareManagerDataTypes.swift; sourceTree = "<group>"; };
@@ -858,6 +862,7 @@
858862
D351F20F2A729C36008C5513 /* LevelSensor.swift */,
859863
D30644002A76CDDE0063DA65 /* IdentificationSensor.swift */,
860864
D370B1492BF600A900BF88BB /* AudioLevelSensor.swift */,
865+
D3E741492D5633740044CCBB /* TemperatureSensor.swift */,
861866
);
862867
path = Sensors;
863868
sourceTree = "<group>";
@@ -1254,6 +1259,7 @@
12541259
D3E6E1922A3ACA6C00BF7095 /* LevelSensor.swift */,
12551260
D370B1472BF6002300BF88BB /* AudioLevelSensor.swift */,
12561261
D30644022A76CE310063DA65 /* IdentificationSensor.swift */,
1262+
D3E741472D56331F0044CCBB /* TemperatureSensor.swift */,
12571263
);
12581264
path = Sensors;
12591265
sourceTree = "<group>";
@@ -1741,6 +1747,7 @@
17411747
D33B52AA2A702D3F001A1BA7 /* NetworkManager.swift in Sources */,
17421748
D35592622B520E21000F633B /* Logger+Ocp1ControllerInternal.swift in Sources */,
17431749
D3AFD35C2B30EC0600A72E9A /* CodingManager.swift in Sources */,
1750+
D3E7414A2D5633740044CCBB /* TemperatureSensor.swift in Sources */,
17441751
D351F2122A729CB0008C5513 /* TimeSource.swift in Sources */,
17451752
D33B52AC2A702D4D001A1BA7 /* DeviceManager.swift in Sources */,
17461753
D355925D2B51E5FF000F633B /* DatagramProxyDeviceEndpoint.swift in Sources */,
@@ -1947,6 +1954,7 @@
19471954
D3E6E2392A3BD52E00BF7095 /* Browser.swift in Sources */,
19481955
D3E6E1DE2A3ACAA900BF7095 /* WellKnownObjectNumbers.swift in Sources */,
19491956
D3FAC8EC2B5CFC11009E2775 /* TaskManagerDataTypes.swift in Sources */,
1957+
D3E741482D56331F0044CCBB /* TemperatureSensor.swift in Sources */,
19501958
D3CFA3602CED4D9F00CAE537 /* Weak.swift in Sources */,
19511959
D3CFA3612CED4D9F00CAE537 /* Locking.swift in Sources */,
19521960
D3E6E1B32A3ACA7B00BF7095 /* Ocp1Connection+Codable.swift in Sources */,

0 commit comments

Comments
 (0)