Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit69ccc54

Browse files
committed
feat: added Remote module that allows remote monitoring of the system (not publicly available since it's in the early stage)
1 parent75912f5 commit69ccc54

File tree

11 files changed

+732
-12
lines changed

11 files changed

+732
-12
lines changed

‎.swiftlint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ identifier_name:
4343
-LineChartHistory
4444
-SpeedPictogramColor
4545
-SensorsWidgetValue
46+
-access_token
47+
-refresh_token
4648

4749
line_length:200
4850

@@ -52,4 +54,4 @@ type_body_length:
5254

5355
file_length:
5456
-1400
55-
-1800
57+
-1800

‎Kit/module/reader.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,16 @@ open class Reader<T: Codable>: NSObject, ReaderInternal_p {
103103
}
104104

105105
publicfunc callback(_ value:T?){
106+
letmoduleKey="\(self.module.stringValue)@\(self.name)"
106107
self.value= value
107108
iflet value{
108109
self.callbackHandler(value)
110+
Remote.shared.send(key: moduleKey, value: value)
109111
iflet ts=self.lastDBWrite,let interval=self.interval,Date().timeIntervalSince(ts)> interval*10{
110-
DB.shared.insert(key:"\(self.module.stringValue)@\(self.name)", value: value, ts:self.history)
112+
DB.shared.insert(key:moduleKey, value: value, ts:self.history)
111113
self.lastDBWrite=Date()
112114
}elseifself.lastDBWrite==nil{
113-
DB.shared.insert(key:"\(self.module.stringValue)@\(self.name)", value: value, ts:self.history)
115+
DB.shared.insert(key:moduleKey, value: value, ts:self.history)
114116
self.lastDBWrite=Date()
115117
}
116118
}

‎Kit/plugins/DB.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public class DB {
7676

7777
publicfunc insert(key:String, value:Codable, ts:Bool=true, force:Bool=false){
7878
self.values[key]= value
79-
guardlet blobData=try?JSONEncoder().encode(value),let str=String(data: blobData, encoding:.utf8)else{return}
79+
guardlet blobData=try?JSONEncoder().encode(value),let str=String(data: blobData, encoding:.utf8)else{return}
8080

8181
if ts{
8282
self.lldb?.insert("\(key)@\(Date().currentTimeSeconds())", value: str)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp