11 Feb 2020 02:38 PM - last edited on 24 Jun 2021 01:50 PM by MaciejNeumann
So I am currently using associated_entity to get the entity of a MSSQL database of which I am creating a plugin:
self.entity = kwargs["associated_entity"]
instance_name = self.entity.properties['mssql_instance_name']
However I see that this is deprecated:
What is the recommendation to use instead?
Solved! Go to Solution.
11 Feb 2020 03:00 PM
Use activation_context instead, such as this:
kwargs['activation_context'].value.processes[0].properties['mssql_instance_name']
11 Feb 2020 03:02 PM
Any chance of updating the documentation?
11 Feb 2020 03:31 PM
@Jakub M. All yours 🙂
28 Oct 2022 04:30 PM
Can I use this to send an availability Event to any Existing Entity? Also, I cannot find the Documentation at all, someone have an updated link? Thanks!
28 Oct 2022 04:36 PM
If you need to send it to *any* existing entity I'd go with calling the Events v2 API endpoint instead from the python code and attach the event based on the entity selector.
31 Oct 2022 08:19 AM
@Mike_LIt feels awkward to use a external URL API "detour" while you using a SDK for an extension that is locally installed. Also makes the extension brittle as the REST API ist not very stable - currently is using Events API V1...
So is it not possible what I want to do, does the SDK not allow me to create availability events for a given entity and only in the context of the custom_device that is generated by the ActiveGate Extension?
31 Oct 2022 10:30 PM
Hi, you will indeed have to go via the API for that use case.
Mike