Closed cr0ybot closed 5 years ago
When we first created the add-on system (API level 1), all of the imports lived in the gateway itself. The code you see in this adapter is for backwards compatibility.
However, that can probably be removed now, as the old style went away a long time ago.
Thanks for the explanation! Maybe this backwards-compatible way of importing could be commented out with an explanation that its for API level 1?
Would you be able to point me towards where the API level is documented (or maybe the source code)? I've been mostly going off referencing other addon's source code, and it seems like they all have the min/max api level set to 2, but I couldn't find anywhere if the latest API level is currently 2 and what the differences are.
There isn't really any documentation on that, because the only major difference between 1 and 2 was that the imports were moved into a proper package for level 2.
Thanks for answering all of my persistent questions! You folks are doing great work.
The add-on classes (
Adapter
,Device
, etc) are being imported in a strange way that doesn't seem to be relevant to externally-developed (3rd party) add-ons.The documentation specifies that imports should be done like so:
Currently it looks like the code is looking for the modules in a parent folder, but these files do not exist in the context of the
addons
folder that our 3rd party addons are meant to live in.