Scrounger / ioBroker.linkeddevices

Create linked objects (datapoints) of your devices with a self-defined structure. This makes it possible to create a structure in ioBroker, where all objects are centralized, e.g. to be used in the vis or scripts.
https://forum.iobroker.net/topic/22301/neuer-adapter-linkeddevices
MIT License
17 stars 11 forks source link

Create Channel object automatically if it not exist #19

Closed SchumyHao closed 5 years ago

SchumyHao commented 5 years ago

Hi @Scrounger This is a PR for #6

Scrounger commented 5 years ago

Please explmain how does this work? This will always creates a channel if its not exists?

SchumyHao commented 5 years ago

Yeap setObjectNotExistsAsync will create a object if not exist. So I use this to create a channel object for linked state object.

image After add this patch, I can set room and function enum for this channel

SchumyHao commented 5 years ago

@Scrounger Do you think this patch can me merged?

Scrounger commented 5 years ago

at the moment i am not clear about this is the right solution. With this solution it will always create a channel or if it still exist, it will be overwritten.

At my opinion it would be better to have an integration in the admin adapter: https://github.com/ioBroker/ioBroker.admin/issues/415

Alternative could be a button to clone channels, devices etc. in the linkeddevices adapter settings. I have to think about that.

SchumyHao commented 5 years ago

setObjectNotExistsAsync only create object if it is not exist.

SchumyHao commented 5 years ago

Without channel object, type-detector will not work perfactly