forked from home-assistant/home-assistant.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-redirect.py
163 lines (158 loc) · 6.24 KB
/
generate-redirect.py
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
import os
dirs = ['components', 'getting-started', 'developers']
template = "<script>document.location = '/{}/{}/';</script>"
for check_dir in dirs:
for path in os.listdir(os.path.join('public', check_dir)):
check_path = os.path.join('public', check_dir, path)
if os.path.isdir(check_path):
new_path = os.path.join('source', check_dir, "{}.html".format(path))
# print(template.format(check_dir, path))
# print(new_path)
with open(new_path, 'w') as outp:
outp.write(template.format(check_dir, path))
# Generated
# source/components/alarm_control_panel.html
# source/components/alarm_control_panel.manual.html
# source/components/alarm_control_panel.mqtt.html
# source/components/arduino.html
# source/components/automation.html
# source/components/browser.html
# source/components/camera.foscam.html
# source/components/camera.generic.html
# source/components/configurator.html
# source/components/conversation.html
# source/components/device_sun_light_trigger.html
# source/components/device_tracker.html
# source/components/device_tracker.actiontec.html
# source/components/device_tracker.aruba.html
# source/components/device_tracker.asuswrt.html
# source/components/device_tracker.ddwrt.html
# source/components/device_tracker.geofancy.html
# source/components/device_tracker.luci.html
# source/components/device_tracker.mqtt.html
# source/components/device_tracker.netgear.html
# source/components/device_tracker.nmap_scanner.html
# source/components/device_tracker.owntracks.html
# source/components/device_tracker.snmp.html
# source/components/device_tracker.thomson.html
# source/components/device_tracker.tomato.html
# source/components/device_tracker.tplink.html
# source/components/device_tracker.ubus.html
# source/components/discovery.html
# source/components/downloader.html
# source/components/group.html
# source/components/history.html
# source/components/ifttt.html
# source/components/ifttt.manything.html
# source/components/introduction.html
# source/components/isy994.html
# source/components/keyboard.html
# source/components/light.html
# source/components/light.blinksticklight.html
# source/components/light.hue.html
# source/components/light.hyperion.html
# source/components/light.limitlessled.html
# source/components/light.rfxtrx.html
# source/components/light.tellstick.html
# source/components/light.vera.html
# source/components/light.wink.html
# source/components/logbook.html
# source/components/media_player.html
# source/components/media_player.cast.html
# source/components/media_player.denon.html
# source/components/media_player.firetv.html
# source/components/media_player.itunes.html
# source/components/media_player.kodi.html
# source/components/media_player.mpd.html
# source/components/media_player.plex.html
# source/components/media_player.sonos.html
# source/components/media_player.squeezebox.html
# source/components/modbus.html
# source/components/mqtt.html
# source/components/notify.html
# source/components/notify.file.html
# source/components/notify.instapush.html
# source/components/notify.nma.html
# source/components/notify.pushbullet.html
# source/components/notify.pushover.html
# source/components/notify.slack.html
# source/components/notify.smtp.html
# source/components/notify.syslog.html
# source/components/notify.telegram.html
# source/components/notify.xmpp.html
# source/components/rfxtrx.html
# source/components/scene.html
# source/components/script.html
# source/components/sensor.html
# source/components/sensor.arduino.html
# source/components/sensor.arest.html
# source/components/sensor.bitcoin.html
# source/components/sensor.command_sensor.html
# source/components/sensor.cpuspeed.html
# source/components/sensor.dht.html
# source/components/sensor.efergy.html
# source/components/sensor.forecast.html
# source/components/sensor.glances.html
# source/components/sensor.modbus.html
# source/components/sensor.mqtt.html
# source/components/sensor.mysensors.html
# source/components/sensor.openweathermap.html
# source/components/sensor.rest.html
# source/components/sensor.rfxtrx.html
# source/components/sensor.rpi_gpio.html
# source/components/sensor.sabnzbd.html
# source/components/sensor.swiss_public_transport.html
# source/components/sensor.systemmonitor.html
# source/components/sensor.tellstick.html
# source/components/sensor.temper.html
# source/components/sensor.time_date.html
# source/components/sensor.transmission.html
# source/components/sensor.vera.html
# source/components/sensor.wink.html
# source/components/sensor.worldclock.html
# source/components/shell_command.html
# source/components/simple_alarm.html
# source/components/sun.html
# source/components/switch.html
# source/components/switch.arduino.html
# source/components/switch.arest.html
# source/components/switch.command_switch.html
# source/components/switch.edimax.html
# source/components/switch.hikvision.html
# source/components/switch.modbus.html
# source/components/switch.mqtt.html
# source/components/switch.rest.html
# source/components/switch.rfxtrx.html
# source/components/switch.rpi_gpio.html
# source/components/switch.tellstick.html
# source/components/switch.transmission.html
# source/components/switch.vera.html
# source/components/switch.wemo.html
# source/components/switch.wink.html
# source/components/tellstick.html
# source/components/thermostat.html
# source/components/thermostat.heat_control.html
# source/components/thermostat.nest.html
# source/components/thermostat.radiotherm.html
# source/components/vera.html
# source/components/verisure.html
# source/components/wink.html
# source/components/zone.html
# source/components/zwave.html
# source/getting-started/android.html
# source/getting-started/automation.html
# source/getting-started/autostart.html
# source/getting-started/configuration.html
# source/getting-started/devices.html
# source/getting-started/presence-detection.html
# source/getting-started/troubleshooting.html
# source/getting-started/troubleshooting-configuration.html
# source/developers/add_new_platform.html
# source/developers/api.html
# source/developers/architecture.html
# source/developers/creating_components.html
# source/developers/credits.html
# source/developers/frontend.html
# source/developers/python_api.html
# source/developers/rest_api.html
# source/developers/website.html