@ledvance/base 1.2.57 → 1.2.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -337,7 +337,6 @@ export function useGroupConfigFeature<GC, GCPT extends PropertyValueTypes<GC>>
337
337
  ...(extraDps || {}),
338
338
  },
339
339
  {
340
- ...groupConfig,
341
340
  ...(extraConfig || {}),
342
341
  [key]: value,
343
342
  },
@@ -360,7 +359,7 @@ export function useFeatureHook<GC, T extends PropertyValueTypes<GC>>(
360
359
  const extraConfig = getExtraConfig ? getExtraConfig(value) : undefined
361
360
  return await setFH(value, dpValue, extraDps, extraConfig)
362
361
  }, [setFH])
363
- return [featureHook || defValue, setFeatureHook]
362
+ return [featureHook ?? defValue, setFeatureHook]
364
363
  }
365
364
 
366
365
  export const useFanMaxSpeed = () => {
@@ -3,4 +3,5 @@ export enum WorkMode {
3
3
  Colour = 'colour',
4
4
  Scene = 'scene',
5
5
  Music = 'music',
6
- }
6
+ Control = 'control'
7
+ }
@@ -0,0 +1,52 @@
1
+ import json
2
+ import os
3
+ import subprocess
4
+ import sys
5
+
6
+
7
+ def main():
8
+ try:
9
+ print('Begin update localazy.')
10
+ # 读取translateKey.txt并生成include_keys
11
+ with open('../translateKey.txt', 'r') as f:
12
+ include_keys = [f'MATCH:{line.strip()}' for line in f]
13
+
14
+ # 读取和更新localazy.json
15
+ with open('localazy.json', 'r+') as f:
16
+ content = json.load(f)
17
+ content['conversion']['actions']['includeKeys'] = include_keys
18
+ f.seek(0)
19
+ f.truncate()
20
+ f.write(json.dumps(content, indent=4, ensure_ascii=False))
21
+
22
+ # 根据平台执行localazy download命令
23
+ params = ['cmd', '/c', 'localazy', 'download'] if sys.platform.startswith('win') else ['localazy', 'download']
24
+ result = subprocess.run(params, stdout=subprocess.PIPE, text=True, errors='ignore')
25
+
26
+ # 检查命令执行结果
27
+ if 'Done.' in result.stdout:
28
+ print('Download localazy successful.')
29
+ else:
30
+ print('Download localazy failed.')
31
+ sys.exit(-1)
32
+
33
+ # 读取strings.json并写入strings.ts
34
+ with open('strings.json', 'r', encoding='utf8') as f:
35
+ string_json = json.load(f)
36
+
37
+ with open('src/i18n/strings.ts', 'w', encoding='utf8') as f:
38
+ pt = string_json.get('pt-BR')
39
+ if pt:
40
+ string_json['pt_BR'] = pt
41
+ f.write(f'export default {json.dumps(string_json, indent=4, ensure_ascii=False)}')
42
+
43
+ os.remove('strings.json')
44
+ print('Update localazy finished.')
45
+
46
+ except Exception as e:
47
+ print(f'An error occurred: {e}')
48
+ sys.exit(-1)
49
+
50
+
51
+ if __name__ == '__main__':
52
+ main()