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();
SetupFeedbacks();
EISC.SigChange += EISC_SigChange;
EISC.OnlineStatusChange += (o, a) =>
{
if (a.DeviceOnLine)
LoadConfigValues();
};
// load config if it's already there
if (EISC.IsOnline || EISC.BooleanInput[BoolJoin.ConfigIsReady].BoolValue)
if (EISC.IsOnline) // || EISC.BooleanInput[BoolJoin.ConfigIsReady].BoolValue)
LoadConfigValues();
return base.CustomActivate();
}
@@ -244,9 +249,6 @@ namespace PepperDash.Essentials.Room.Cotija
// Config things
EISC.SetSigTrueAction(BoolJoin.ConfigIsReady, LoadConfigValues);
}
/// <summary>
@@ -254,6 +256,8 @@ namespace PepperDash.Essentials.Room.Cotija
/// </summary>
void LoadConfigValues()
{
Debug.Console(1, this, "Loading configuration from DDVC01 EISC bridge");
ConfigIsLoaded = false;
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));
ConfigIsLoaded = true;
// send config changed status???