Commit 56a7223 1 parent e00f8c8 commit 56a7223 Copy full SHA for 56a7223
File tree 3 files changed +7
-8
lines changed
custom_components/zha_toolkit
3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -1855,7 +1855,7 @@ data:
1855
1855
# Optional: JSON file to write devices data to - located in /config/json/...
1856
1856
json_out: zha_devices.json
1857
1857
# Optional: Add timestamp to Filename of JSON file. Defaults to False.
1858
- json_timestamp: True
1858
+ json_timestamp: true
1859
1859
event_done: zha_devices
1860
1860
` ` `
1861
1861
Original file line number Diff line number Diff line change @@ -580,11 +580,11 @@ def write_json_to_file(
580
580
os .mkdir (out_dir )
581
581
582
582
if ts is not None :
583
- if '.' in fname :
584
- base , ext = fname .rsplit ('.' , 1 )
585
- fname = base + '_' + ts + '.' + ext
583
+ if "." in fname :
584
+ base , ext = fname .rsplit ("." , 1 )
585
+ fname = base + "_" + ts + "." + ext
586
586
else :
587
- fname = fname + '_' + ts
587
+ fname = fname + "_" + ts
588
588
if normalize_name :
589
589
file_name = os .path .join (out_dir , normalize_filename (fname ))
590
590
else :
Original file line number Diff line number Diff line change @@ -125,14 +125,13 @@ async def zha_devices(
125
125
if params [p .JSON_OUT ] is not None :
126
126
timeStamp = None
127
127
if params [p .JSON_TIMESTAMP ] is not None :
128
- timeStamp = event_data [' start_time' ].split ('.' , 1 )[0 ]
128
+ timeStamp = event_data [" start_time" ].split ("." , 1 )[0 ]
129
129
u .write_json_to_file (
130
130
event_data ,
131
131
subdir = "json" ,
132
132
fname = params [p .JSON_OUT ],
133
133
desc = "zha_devices" ,
134
134
listener = listener ,
135
135
normalize_name = False ,
136
- ts = timeStamp
136
+ ts = timeStamp ,
137
137
)
138
-
You can’t perform that action at this time.
0 commit comments