Update to SpaceAPI schema 15

This commit is contained in:
polyfloyd 2025-05-12 21:00:07 +02:00
parent 14dfb79cfb
commit 305f0fa99f
2 changed files with 24 additions and 17 deletions

View file

@ -1,11 +1,11 @@
#!/usr/bin/env python3
import paho.mqtt.client as mqtt
import time
import paho.mqtt.client as mqtt
import tornado.ioloop
import tornado.web
PORT = 8888
BASE_URL = "https://bitlair.nl/state"
MQTT_HOST = "bitlair.nl"
@ -18,25 +18,21 @@ current_state_change = time.time()
def state():
global current_state, current_state_change
return {
"api": "0.13",
"api_compatibility": ["15"],
"space": "Bitlair",
"logo": BASE_URL + "/logo.png",
"url": "https://bitlair.nl/",
"contact": {
"irc": "irc://irc.smurfnet.ch/bitlair",
"twitter": "@bitlair",
"email": "bestuur@bitlair.nl",
"ml": "general@list.bitlair.nl",
},
"spacefed": {
"spacenet": True,
"spacesaml": True,
"spacephone": False,
},
"location": {
"address": "Nijverheidsweg-Noord 77, 3812 PK Amersfoort, The Netherlands",
"lat": 52.1697399,
"lon": 5.3561364,
"timezone": "Europe/Amsterdam",
"country_code": "NL",
"hint": "Ingang aan de oost-zijde van het pand, blauwe deur",
},
"spacefed": {
"spacenet": True,
"spacesaml": True,
},
"state": {
"open": current_state,
@ -45,6 +41,7 @@ def state():
"open": BASE_URL + "/open.png",
"closed": BASE_URL + "/closed.png",
},
# mqtt is out-of-spec
"mqtt": {
"host": "bitlair.nl",
"port": 1883,
@ -54,7 +51,18 @@ def state():
"open": "open",
},
},
"issue_report_channels": ["twitter"],
"contact": {
"irc": "irc://irc.smurfnet.ch/bitlair",
"mastodon": "@bitlair@hsnl.social",
"email": "bestuur@bitlair.nl",
"ml": "general@list.bitlair.nl",
},
"feeds": {
"calendar": {
"type": "ical",
"url": "https://bitlair.nl/events.ics",
},
},
}

View file

@ -1,13 +1,12 @@
import requests
from jsonschema import validate
import server
def test_schema_compliance():
resp = requests.get(
"https://raw.githubusercontent.com/SpaceApi/schema/refs/heads/master/13.json"
"https://raw.githubusercontent.com/SpaceApi/schema/refs/heads/master/15.json"
)
resp.raise_for_status()
schema = resp.json()