@@ -106,10 +106,10 @@ def value(self, value):
106
106
)
107
107
self ._updated = True
108
108
self .timestamp = timestamp ()
109
- logging . debug (
110
- f"record : { self .name } %s : { value } ts: { self .timestamp } "
111
- % ( "initialized" if self . value is None else "updated" )
112
- )
109
+ if ( self . value is None ):
110
+ logging . info ( f"Init : { self .name } value : { value } ts: { self .timestamp } ")
111
+ else :
112
+ logging . debug ( f"Update: { self . name } value: { value } ts: { self . timestamp } " )
113
113
self ._value = value
114
114
115
115
def __is_subrecord (self , attr ):
@@ -218,7 +218,7 @@ def update_systime(self):
218
218
219
219
def create_task (self , name , coro , * args , ** kwargs ):
220
220
self .tasks [name ] = asyncio .create_task (coro (* args ))
221
- logging .debug (f"task: { name } created." )
221
+ logging .info (f"task: { name } created." )
222
222
223
223
def create_topic (self , topic , inout ):
224
224
return bytes (f"/a/t/{ self .thing_id } /{ topic } /{ inout } " , "utf-8" )
@@ -244,9 +244,9 @@ def senml_generic_callback(self, record, **kwargs):
244
244
# This callback catches all unknown/umatched sub/records that were not part of the pack.
245
245
rname , sname = record .name .split (":" ) if ":" in record .name else [record .name , None ]
246
246
if rname in self .records :
247
- logging .debug (f"Ignoring cloud initialization for record: { record .name } " )
247
+ logging .info (f"Ignoring cloud initialization for record: { record .name } " )
248
248
else :
249
- logging .info (f"Unkown record found: { record .name } value: { record .value } " )
249
+ logging .warning (f"Unkown record found: { record .name } value: { record .value } " )
250
250
251
251
def mqtt_callback (self , topic , message ):
252
252
logging .debug (f"mqtt topic: { topic [- 8 :]} ... message: { message [:8 ]} ..." )
@@ -285,7 +285,7 @@ async def mqtt_task(self, interval=0.100):
285
285
record .add_to_pack (self .senmlpack , push = True )
286
286
if len (self .senmlpack ._data ):
287
287
logging .debug ("Pushing records to Arduino IoT cloud:" )
288
- for record in self .senmlpack :
288
+ for record in self .senmlpack . _data :
289
289
logging .debug (f" ==> record: { record .name } value: { str (record .value )[:48 ]} ..." )
290
290
self .mqtt .publish (self .topic_out , self .senmlpack .to_cbor (), qos = True )
291
291
self .last_ping = timestamp ()
0 commit comments