api/alfred: Introduce NoCoordinates hood
Previously, mesh routers without coordinates are assigned to the default hood, even if they are meshing with routers from other hoods. To keep the default hood clean, we introduce the "NoCoordinates" hood for all those routers. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
4dab09748c
commit
907b3154a9
|
@ -10,6 +10,11 @@ import math
|
|||
mysql = FreifunkMySQL()
|
||||
|
||||
hoods = [
|
||||
{
|
||||
"keyxchange_id": 0,
|
||||
"name": "NoCoordinates",
|
||||
"net": ""
|
||||
},
|
||||
{
|
||||
"keyxchange_id": 1,
|
||||
"name": "Default",
|
||||
|
|
|
@ -106,6 +106,8 @@ def import_nodewatcher_xml(mysql, mac, xml, banned, netifdict):
|
|||
""",(lat,lng,lat,),"name")
|
||||
if not router_update["hood"]:
|
||||
router_update["hood"] = "Default"
|
||||
if router_update["neighbours"] and not router_update["has_wan_uplink"]:
|
||||
router_update["hood"] = "NoCoordinates"
|
||||
if not router_update['lat'] and not router_update['lng'] and olddata and olddata['lat'] and olddata['lng']:
|
||||
# Enable reset state; do before variable fallback
|
||||
reset = True
|
||||
|
|
Loading…
Reference in New Issue