State Device -> Add onStatechanged method to call custom functions.   Method takes a state parameter and kwargs for prev and source.