MycroftAI / mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform.
https://mycroft.ai
Apache License 2.0
6.51k stars 1.27k forks source link

self.gui does not sync dicts correctly #2978

Open JarbasAl opened 3 years ago

JarbasAl commented 3 years ago

the base gui class only syncs values for top level keys

proposed fix

https://github.com/HelloChatterbox/HolmesV/commit/64b77f297eadda6eca55f1e990934d5ba867d1cc

krisgesling commented 3 years ago

Hmm, haven't run into this, but I'm sure we will as GUI's get more complicated.

Would this be easier if we shift the dict to be it's own dict eg, self.gui.data[key]?

JarbasAl commented 3 years ago

i hit this here https://github.com/OpenVoiceOS/OVOS-workshop/blob/master/ovos_workshop/frameworks/playback/interface.py#L484

i was assigning 2 keys under "media" and they did not propagate, because they dont hit the __set__ method from the GUI class. also note that each assignment sends 1 bus message, so that linked method now is optimized to send 1 bus message only