Skip to content

Instantly share code, notes, and snippets.

@DaleGia
DaleGia / Node1Management_example.py
Created March 10, 2019 13:22
Node1Management Management Node Example
def TurnOn(arg = None):
print("Turning Tv and DVD On")
lookup_remote_action("Node2TvTurnOn").call()
lookup_remote_action("Node3DvdTurnOn").call()
def UpdateStatus(message):
print('Management Status: Status requested')
tvMessage = lookup_remote_event("TvStatus").getArg().get('message')
dvdMessage = lookup_remote_event("DvdStatus").getArg().get('message')
aggregateMessage = "TvStatus: " + tvMessage + ' - ' + "DvdStatus: " + dvdMessage
@DaleGia
DaleGia / Node3Dvd_example.py
Created March 10, 2019 13:18
Node3Dvd Device Node example
# Only required for placeholder status function
import random
def TurnOn(arg = None):
print("Turning Dvd On")
print("Turning Dvd On function not yet implemented. Doing nothing...")
UpdateStatus();
def UpdateStatus(arg = None):
print('Dvd Status: Status requested')
@DaleGia
DaleGia / node2Tv_example.py
Created March 10, 2019 13:14
Node2Tv Device Node example
# Only required for placeholder status function
import random
def TurnOn(arg = None):
print("Turning Tv On")
print("Turning Tv On function not yet implemented. Doing nothing...")
UpdateStatus();
def UpdateStatus(arg = None):
print('TV Status: Status requested')
@DaleGia
DaleGia / nodel_remote_event_control_example.csv
Created March 10, 2019 11:40
Node requirements for Remote Event control implementation
Node 1 Management Node 2 TV Node 3 DVD
Local Action: TurnOn Local Action: TurnOn Local Action: TurnOn
Local Event: Node2TvTurnOn Remote Event: Node1Management: Node2TvTurnOn Remote Event: Node1Management: Node3DvdTurnOn
Local Event: Node3DvdTurnOn Local Event: TvStatus Local Event: DvdStatus
Local Event: ManagementStatus
Local Event: TvStatus
Local Event: DvdStatus
Remote Event: Node2TV: TvStatus
Remote Event: Node3DVD: DvdStatus
@DaleGia
DaleGia / nodel_remote_action_control_example.csv
Created March 10, 2019 11:36
Node requirements for Remote Action control implementation
Node 1 Management Node 2 TV Node 3 DVD
Local Action: TurnOn Local Action: TurnOn Local Action: TurnOn
Remote Action: Node2TV: TurnOn Local Event: TvStatus Local Event: DvdStatus
Remote Action: Node3DVD: TurnOn
Local Event: ManagementStatus
Local Event: TvStatus
Local Event: DvdStatus
Remote Event: Node2TV: TvStatus
Remote Event: Node3DVD: DvdStatus
@DaleGia
DaleGia / nodel_example_functions.py
Created March 10, 2019 11:29
Nodel Example Fucntions
# These functions create Actions, Events, and Parameters based the provided
# name and metadata.
def create_local_event(name, metadata=None)
def create_local_action(name, handler, metadata=None)
def create_remote_action(name, metadata=None, suggestedNode=None, suggestedAction=None)
def create_remote_event(name, handler, metadata=None, suggestedNode=None, suggestedEvent=None)
def Parameter(schemaDictOrJSONorTitle = None)
# These functions look for existing Actions, Events, and Parameters based on a
# string name. They return None if the Action/Event/Parameter could not be