Refreshing Menus and Data Dynamically

I’ve been writing a plugin for Plex and it’s going pretty well but I hit a wall and I am hoping that someone can help me out. The plugin is working with my home automation system and parsing the XML retrieved from the server, one of the things it does is allow me to turn a light on or off. I would like to have the code trigger a refresh of the XML data when someone does that so that the device in the menu will show properly as on or off. So the two questions I have are:


  1. How to force the function I wrote in Python to run each time an action is run (i.e., turn on or turn off), where it will go out to the server, grab the XML and refresh the current DirectoryItem container that I’m using. That way when I turn it off, for instance, the container updates and now the subtitle shows “Off”
  2. How to, without selecting an on/off menu item, have the list automatically refresh in case the light has changed status recently



    I have tried using noCache=True and autoRefresh=5 on the DirectoryItem append command but that doesn’t seem to do the trick. If I go back out to the plugin’s main menu and drill back down manually then the function gets re-run and everything is up-to-date.



    Any good solution to this conundrum?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.