Trying to force config values to load in lieu of proper signalling from Simpl code

This commit is contained in:
Heath Volmer
2018-02-02 15:34:37 -07:00
parent 491fff2793
commit 645816c75f
2 changed files with 8 additions and 5 deletions

View File

@@ -156,8 +156,13 @@ namespace PepperDash.Essentials.Room.Cotija
SetupFunctions(); SetupFunctions();
SetupFeedbacks(); SetupFeedbacks();
EISC.SigChange += EISC_SigChange; EISC.SigChange += EISC_SigChange;
EISC.OnlineStatusChange += (o, a) =>
{
if (a.DeviceOnLine)
LoadConfigValues();
};
// load config if it's already there // load config if it's already there
if (EISC.IsOnline || EISC.BooleanInput[BoolJoin.ConfigIsReady].BoolValue) if (EISC.IsOnline) // || EISC.BooleanInput[BoolJoin.ConfigIsReady].BoolValue)
LoadConfigValues(); LoadConfigValues();
return base.CustomActivate(); return base.CustomActivate();
} }
@@ -244,9 +249,6 @@ namespace PepperDash.Essentials.Room.Cotija
// Config things // Config things
EISC.SetSigTrueAction(BoolJoin.ConfigIsReady, LoadConfigValues); EISC.SetSigTrueAction(BoolJoin.ConfigIsReady, LoadConfigValues);
} }
/// <summary> /// <summary>
@@ -254,6 +256,8 @@ namespace PepperDash.Essentials.Room.Cotija
/// </summary> /// </summary>
void LoadConfigValues() void LoadConfigValues()
{ {
Debug.Console(1, this, "Loading configuration from DDVC01 EISC bridge");
ConfigIsLoaded = false; ConfigIsLoaded = false;
var co = ConfigReader.ConfigObject; var co = ConfigReader.ConfigObject;
@@ -335,7 +339,6 @@ namespace PepperDash.Essentials.Room.Cotija
Debug.Console(0, this, "******* CONFIG FROM DDVC: \r", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented)); Debug.Console(0, this, "******* CONFIG FROM DDVC: \r", JsonConvert.SerializeObject(ConfigReader.ConfigObject, Formatting.Indented));
ConfigIsLoaded = true; ConfigIsLoaded = true;
// send config changed status??? // send config changed status???