deconz_fw_downloader/ikea.py
Daniel Demus cadbbb8666 Add download from github.com/koenkk
Pythony naming
Signed-off-by: Daniel Demus <daniel-github@demus.dk>
2022-10-04 00:01:06 +02:00

25 lines
566 B
Python

#!/usr/bin/env python3
import json
from urllib.request import urlopen
from downloader import Downloader
class Ikea(Downloader):
def get_url_list(self):
f = urlopen("http://fw.ota.homesmart.ikea.net/feed/version_info.json")
data = f.read()
arr = json.loads(data)
res = []
for i in arr:
if 'fw_binary_url' in i:
url = i['fw_binary_url']
ls = url.split('/')
fname = ls[len(ls) - 1]
res.append((url, fname))
return res