-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add feature : object alias #689
base: master
Are you sure you want to change the base?
Conversation
I work again on this feature. |
I don't think using SDBM for storing a hash of user defined alias names is the right way to go... I think the alias should be reversible, so needs to be stored. It can also impact the event which are send out to pXbY topics now, but maybe should also use the alias if set. What about multiple objects with the same alias etc... |
Yes, I've already thought about that. I'm working on extending that. I would then like to save the hash and the string. A check as to whether the hash already exists will also be added. However, the question is what should happen if the hash already exists? Just display an error message? Further discussion here: #365 |
Please review warning for duplicate removed - Does not run reliably and leads to problems when starting openHasp |
Object alias
An alias can be assigned to each object. This means that the object can be accessed not only with the page number and ID (pXbY) but also by alias. The advantage of this is that the position of the object does not have to be known. For example, it is possible to change the status of a button on several plates with a single command via MQTT, even though the button has a different position on different plates.
When using the alias, the command must be preceded by an '@', for example "@Alpha.text"
To be able to use alias, USE_OBJ_ALIAS must be greater than zero when compiling.
#define USE_OBJ_ALIAS 1
Example :
pages.jsonl
MQTT :
Topic : hasp/plates/command/@bravo.bg_color
Payload : #888800