-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathtools.mk
More file actions
61 lines (48 loc) · 2.19 KB
/
tools.mk
File metadata and controls
61 lines (48 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
help:
@echo "Tools Makefile - Integration and Documentation Commands"
@echo ""
@echo "Available targets:"
@echo ""
@echo " Zigbee2MQTT:"
@echo " clean_z2m_index - Clear all Zigbee2MQTT OTA index files"
@echo " update_converters - Generate Z2M converter files based on device database"
@echo " freeze_ota_links - Replace branch refs with commit hashes in OTA indices"
@echo ""
@echo " ZHA:"
@echo " update_zha_quirk - Generate ZHA quirks file from device database"
@echo ""
@echo " HOMEd:"
@echo " update_homed_extension - Generate HOMEd extension file from device database"
@echo ""
@echo " Documentation:"
@echo " update_supported_devices - Generate supported devices documentation"
@echo ""
@echo " Development Utilities:"
@echo " unused_image_type - Show next available firmware image type ID"
@echo ""
# Clear all Zigbee2MQTT index files
clean_z2m_index:
@echo "[]" > zigbee2mqtt/ota/index_router-FORCE.json
@echo "[]" > zigbee2mqtt/ota/index_end_device-FORCE.json
@echo "[]" > zigbee2mqtt/ota/index_router.json
@echo "[]" > zigbee2mqtt/ota/index_end_device.json
# Update Zigbee2MQTT converter files
update_converters:
python3 helper_scripts/make_z2m_tuya_converters.py device_db.yaml \
> zigbee2mqtt/converters/tuya_with_ota.js
python3 helper_scripts/make_z2m_tuya_converters.py --z2m-v1 device_db.yaml \
> zigbee2mqtt/converters_v1/tuya_with_ota.js
python3 helper_scripts/make_z2m_custom_converters.py device_db.yaml \
> zigbee2mqtt/converters/switch_custom.js
python3 helper_scripts/make_z2m_custom_converters.py --z2m-v1 device_db.yaml \
> zigbee2mqtt/converters_v1/switch_custom.js
update_zha_quirk:
python3 helper_scripts/make_zha_quirk.py device_db.yaml > zha/switch_quirk.py
update_homed_extension:
python3 helper_scripts/make_homed_extension.py device_db.yaml > homed/tuya-custom.json
update_supported_devices:
python3 helper_scripts/make_supported_devices.py device_db.yaml > docs/supported_devices.md
freeze_ota_links:
sed -i "s|refs\/heads\/$(shell git branch --show-current)|$(shell git rev-parse HEAD)|g" zigbee2mqtt/ota/*.json
unused_image_type:
@yq '[.[] | .firmware_image_type] | max + 1' device_db.yaml