Skip to content

Commit

Permalink
Merge remote-tracking branch 'mrg_main/main' into work
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed May 24, 2024
2 parents 5683290 + e57f979 commit bf2fd53
Show file tree
Hide file tree
Showing 221 changed files with 14,175 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Tasmota

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[![Tasmota install](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/banner-direct.svg)](https://github.com/vshymanskyy/StandWithUkraine/blob/main/docs/README.md)

![Tasmota logo](https://github.com/arendst/Tasmota/blob/development/tools/logo/TASMOTA_FullLogo_Vector.svg#gh-light-mode-only)![Tasmota logo](https://github.com/arendst/Tasmota/blob/development/tools/logo/TASMOTA_FullLogo_Vector_White.svg#gh-dark-mode-only)

Alternative firmware for ESP8266/ESP32 based devices with **easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX**.

If you like **Tasmota**, give it a star, or fork it and contribute!

[![GitHub stars](https://img.shields.io/github/stars/arendst/Tasmota.svg?style=social&label=Star)](https://github.com/arendst/Tasmota/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/arendst/Tasmota.svg?style=social&label=Fork)](https://github.com/arendst/Tasmota/network)
[![donate](https://img.shields.io/badge/donate-PayPal-blue.svg)](https://paypal.me/tasmota)

See [CHANGELOG](https://github.com/arendst/Tasmota/blob/development/CHANGELOG.md) for changes since last release.

Easy initial installation of Tasmota via **[Tasmota WebInstaller](https://tasmota.github.io/install/)**. The actual development / release builds and the unofficial firmwares are available. It is important to note that development binaries are based on the current codebase. These commits are tested as much as is possible and are typically quite stable. However, it is infeasible to test on the hundreds of different types of devices with all the available configuration options permitted.
The unofficial special build variants are **not** tested nor supported. Dont blame anyone when using ;-)

## Disclaimer

:warning: **DANGER OF ELECTROCUTION** :warning:

If your device connects to mains electricity (AC power) there is danger of electrocution if not installed properly. If you don't know how to install it, please call an electrician (***Beware:*** certain countries prohibit installation without a licensed electrician present). Remember: _**SAFETY FIRST**_. It is not worth the risk to yourself, your family and your home if you don't know exactly what you are doing. Never tinker or try to flash a device using the serial programming interface while it is connected to MAINS ELECTRICITY (AC power).

We don't take any responsibility nor liability for using this software nor for the installation or any tips, advice, videos, etc. given by any member of this site or any related site.
Binary file added favicon.ico
Binary file not shown.
133 changes: 133 additions & 0 deletions genManifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
#!/usr/bin/python3

from platform import release
import sys
from os import listdir
from os import mkdir
from os import remove
from os import path
import json
import requests
import gzip
import re


def convertJSON(infile,outfile):
with open(infile) as json_file:
data = json.load(json_file)
for build in data['builds']:
for path in build['parts']:
# print(path['path'])
path['path'] = path['path'].replace("..", "https://tasmota.github.io/install")

# print(data)
j = json.dumps(data,indent=4)
f = open(outfile,"w")
f.write(j)
f.close()

def getManifestEntry(manifest):
entry = {}
with open(manifest) as json_file:
data = json.load(json_file)
entry['path'] = "https://tasmota.github.io/install/" + manifest
entry['name'] = data['name']
entry['chipFamilies'] = []
for build in data['builds']:
entry['chipFamilies'].append(build['chipFamily'])
return entry



def main(args):
path_manifests = path.join('manifest')
path_manifests_ext = path.join('manifest_ext')
if not path.exists(path_manifests):
print("No manifest folder, exiting ...")
return -1
files = listdir(path_manifests)
if len(files) == 0:
print("Empty manifest folder, exiting ...")
return -1
if path.exists(path_manifests_ext):
m_e_files = listdir(path_manifests_ext)
# for file in m_e_files:
# remove(file)
else:
mkdir(path_manifests_ext)


output = {}

for file in files:
# create absolute path-version of each manifest file in /manifest_ext
convertJSON(path.join(path_manifests,file),path.join(path_manifests_ext,file))
line = file.split('.')
if len(line) != 4:
print("Incompatible path name, ignoring file:",file)
continue
# print(line[1])
if line[0] not in output:
output[line[0]] = [[],[],[],[],[],[]]
if line[1] == "tasmota":
output[line[0]][0].insert(0,getManifestEntry(path.join(path_manifests_ext,file))) # vanilla first
continue
elif line[1] == "tasmota32":
output[line[0]][1].insert(0,getManifestEntry(path.join(path_manifests_ext,file)))
continue
elif len(line[1].split('-')) == 1: #solo1,4M,...
output[line[0]][2].append(getManifestEntry(path.join(path_manifests_ext,file)))
continue
name_components = line[1].split('-')
if name_components[0] == "tasmota":
if len(name_components[1]) == 2 and name_components[1].isupper():
output[line[0]][1].append(getManifestEntry(path.join(path_manifests_ext,file))) # language versions last
continue
output[line[0]][0].append(getManifestEntry(path.join(path_manifests_ext,file)))
continue
elif name_components[0] == "tasmota32":
if len(name_components[1]) == 2 and name_components[1].isupper():
output[line[0]][3].append(getManifestEntry(path.join(path_manifests_ext,file))) # language versions last
continue
output[line[0]][2].append(getManifestEntry(path.join(path_manifests_ext,file)))
continue
else: #solo1,4M,...
if len(name_components[1]) == 2 and name_components[1].isupper():
output[line[0]][5].append(getManifestEntry(path.join(path_manifests_ext,file))) # language versions last
continue
output[line[0]][4].append(getManifestEntry(path.join(path_manifests_ext,file)))
# print(output)

for section in output:
merged = sorted(output[section][0],key=lambda d: d['name']) + sorted(output[section][1],key=lambda d: d['name']) + sorted(output[section][2],key=lambda d: d['name']) + sorted(output[section][3],key=lambda d: d['name']) + sorted(output[section][4],key=lambda d: d['name']) + sorted(output[section][5],key=lambda d: d['name'])
output[section] = merged

release = output.pop("release")
development = output.pop("development")
unofficial = output.pop("unofficial")


final_json = {}
final_json["release"] = release
final_json["development"] = development
final_json["unofficial"] = unofficial
for key in output:
final_json[key] = output[key] # just in case we have another section in the future


# print(final_json)

j = json.dumps(final_json,indent=4)
f = open("manifests.json", "w")
f.write(j)
f.close()

# intermediate version with double output (DEPRECATED)
f = open("manifests_new.json", "w")
f.write(j)
f.close()
# end deprecated version

if __name__ == '__main__':
sys.exit(main(sys.argv))
# end if
129 changes: 129 additions & 0 deletions genManifestRelease.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
#!/usr/bin/python3

from curses.ascii import isupper
from platform import release
import sys
from os import listdir
from os import mkdir
from os import remove
from os import path
import json

def convertJSON(infile, outfile, tag):
with open(infile) as json_file:
data = json.load(json_file)
for build in data['builds']:
for path in build['parts']:
components = path['path'].split("/")
path['path'] = "https://github.com/tasmota/install/releases/download/" + tag + "/" + components[-1]
# print(data)
j = json.dumps(data,indent=4)
f = open(outfile,"w")
f.write(j)
f.close()

def getManifestEntry(manifest, tag):
entry = {}
with open(manifest) as json_file:
data = json.load(json_file)
components = manifest.split("/")
entry['path'] = "https://github.com/tasmota/install/releases/download/" + tag + "/" + components[-1]
entry['name'] = data['name']
entry['chipFamilies'] = []
for build in data['builds']:
entry['chipFamilies'].append(build['chipFamily'])
return entry

def getTag():
with open("tag_latest.txt") as tag:
tag_latest = tag.readline().strip()
return tag_latest


def main(args):
path_manifests = path.join('manifest')
path_manifests_release = path.join('manifest_release')
if not path.exists(path_manifests):
print("No manifest folder, exiting ...")
return -1
files = listdir(path_manifests)
if len(files) == 0:
print("Empty manifest folder, exiting ...")
return -1
if path.exists(path_manifests_release):
m_e_files = listdir(path_manifests_release)
# for file in m_e_files:
# remove(file)
else:
mkdir(path_manifests_release)

tag_latest = getTag()

output = {}

for file in files:
# create absolute path-version of each manifest file in /manifest_ext
convertJSON(path.join(path_manifests,file),path.join(path_manifests_release,file),tag_latest)
line = file.split('.')
if len(line) != 4:
print("Incompatible path name, ignoring file:",file)
continue
# print(line[1])
if line[0] not in output:
output[line[0]] = [[],[],[],[],[],[]]
if line[1] == "tasmota":
print(path.join(path_manifests_release,file),tag_latest)
output[line[0]][0].insert(0,getManifestEntry(path.join(path_manifests_release,file),tag_latest)) # vanilla first
continue
elif line[1] == "tasmota32":
output[line[0]][1].insert(0,getManifestEntry(path.join(path_manifests_release,file),tag_latest))
continue
else: #solo1,4M,...
output[line[0]][2].append(getManifestEntry(path.join(path_manifests_release,file),tag_latest))
continue
name_components = line[1].split('-')
if name_components[0] == "tasmota":
if len(name_components[1]) and name_components[1].isupper():
output[line[0]][1].append(getManifestEntry(path.join(path_manifests_release,file),tag_latest)) # language versions last
continue
output[line[0]][0].append(getManifestEntry(path.join(path_manifests_release,file),tag_latest))
continue
elif name_components[0] == "tasmota32":
if len(name_components[1]) and name_components[1].isupper():
output[line[0]][3].append(getManifestEntry(path.join(path_manifests_release,file),tag_latest)) # language versions last
continue
output[line[0]][2].append(getManifestEntry(path.join(path_manifests_release,file),tag_latest))
continue
else: #solo1,4M,...
if len(name_components[1]) and name_components[1].isupper():
output[line[0]][5].append(getManifestEntry(path.join(path_manifests_release,file),tag_latest)) # language versions last
continue
output[line[0]][4].append(getManifestEntry(path.join(path_manifests_release,file),tag_latest))
# print(output)

for section in output:
merged = sorted(output[section][0],key=lambda d: d['name']) + sorted(output[section][1],key=lambda d: d['name']) + sorted(output[section][2],key=lambda d: d['name']) + sorted(output[section][3],key=lambda d: d['name']) + sorted(output[section][4],key=lambda d: d['name']) + sorted(output[section][5],key=lambda d: d['name'])
output[section] = merged

release = output.pop("release")
development = output.pop("development")
unofficial = output.pop("unofficial")


final_json = {}
final_json["release"] = release
final_json["development"] = development
final_json["unofficial"] = unofficial
for key in output:
final_json[key] = output[key] # just in case we have another section in the future

print(final_json)
j = json.dumps(final_json,indent=4)
f = open("manifests_release.json", "w")
f.write(j)
f.close()
# end deprecated version

if __name__ == '__main__':
sys.exit(main(sys.argv))
# end if
Loading

0 comments on commit bf2fd53

Please sign in to comment.