diff --git a/platformio/project/config.py b/platformio/project/config.py index 82b76abf09..e9d5a3f7d8 100644 --- a/platformio/project/config.py +++ b/platformio/project/config.py @@ -531,8 +531,11 @@ def __repr__(self): def as_tuple(self): return [(s, self.items(s)) for s in self.sections()] + def as_dict(self): + return {s: self.items(s, as_dict=True) for s in self.sections()} + def to_json(self): - return json.dumps(self.as_tuple()) + return json.dumps(self.as_dict()) def update(self, data, clear=False): assert isinstance(data, list)