openwebrx/owrx/jsons.py

13 lines
334 B
Python
Raw Permalink Normal View History

from owrx.property import PropertyManager
2023-05-06 00:25:23 +02:00
from owrx.active.list import ActiveList
import json
class Encoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, PropertyManager):
return o.__dict__()
2023-05-06 00:25:23 +02:00
if isinstance(o, ActiveList):
return o.__list__()
return super().default(o)