Skip to content

Commit

Permalink
Merge pull request #4 from aknotwot/dev
Browse files Browse the repository at this point in the history
0.5 release
  • Loading branch information
aknotwot authored Nov 2, 2024
2 parents b460074 + 51d7325 commit 61134d5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
36 changes: 13 additions & 23 deletions indi_ipx800.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,21 +233,21 @@ bool Ipx800::initProperties()
IUFillSwitch(&Relay8StateS[i], name, nameM, ISS_OFF);
}
IUFillSwitchVector(&RelaysStatesSP[0], Relay1StateS, 2, getDeviceName(), "RELAY_1_STATE", "Relay 1", RAW_DATA_TAB,
IP_RW,ISR_1OFMANY, 60, IPS_IDLE);
IP_RO,ISR_1OFMANY, 60, IPS_IDLE);
IUFillSwitchVector(&RelaysStatesSP[1], Relay2StateS, 2, getDeviceName(), "RELAY_2_STATE", "Relay 2", RAW_DATA_TAB,
IP_RW,ISR_1OFMANY, 60, IPS_IDLE);
IP_RO,ISR_1OFMANY, 60, IPS_IDLE);
IUFillSwitchVector(&RelaysStatesSP[2], Relay3StateS, 2, getDeviceName(), "RELAY_3_STATE", "Relay 3", RAW_DATA_TAB,
IP_RW,ISR_1OFMANY, 60, IPS_IDLE);
IP_RO,ISR_1OFMANY, 60, IPS_IDLE);
IUFillSwitchVector(&RelaysStatesSP[3], Relay4StateS, 2, getDeviceName(), "RELAY_4_STATE", "Relay 4", RAW_DATA_TAB,
IP_RW,ISR_1OFMANY, 60, IPS_IDLE);
IP_RO,ISR_1OFMANY, 60, IPS_IDLE);
IUFillSwitchVector(&RelaysStatesSP[4], Relay5StateS, 2, getDeviceName(), "RELAY_5_STATE", "Relay 5", RAW_DATA_TAB,
IP_RW,ISR_1OFMANY, 60, IPS_IDLE);
IP_RO,ISR_1OFMANY, 60, IPS_IDLE);
IUFillSwitchVector(&RelaysStatesSP[5], Relay6StateS, 2, getDeviceName(), "RELAY_6_STATE", "Relay 6", RAW_DATA_TAB,
IP_RW,ISR_1OFMANY, 60, IPS_IDLE);
IP_RO,ISR_1OFMANY, 60, IPS_IDLE);
IUFillSwitchVector(&RelaysStatesSP[6], Relay7StateS, 2, getDeviceName(), "RELAY_7_STATE", "Relay 7", RAW_DATA_TAB,
IP_RW,ISR_1OFMANY, 60, IPS_IDLE);
IP_RO,ISR_1OFMANY, 60, IPS_IDLE);
IUFillSwitchVector(&RelaysStatesSP[7], Relay8StateS, 2, getDeviceName(), "RELAY_8_STATE", "Relay 8", RAW_DATA_TAB,
IP_RW,ISR_1OFMANY, 60, IPS_IDLE);
IP_RO,ISR_1OFMANY, 60, IPS_IDLE);

//////////////////////////////////////////////////////////
//page de presentation de l'état des entrées discretes
Expand Down Expand Up @@ -431,7 +431,7 @@ bool Ipx800::ISNewSwitch(const char *dev, const char *name, ISState *states, cha
if (INDI::OutputInterface::processSwitch(dev, name, states, names, n))
return true;

// Vérifie que l'événement concerne le vecteur de commutateurs Roof Engine Power
// Vérifie que l'événement concerne le vecteur de commutateurs Roof Engine Power Management - Options Tab
if (strcmp(name, roofEnginePowerSP.name) == 0)
{
// Parcours des commutateurs pour traiter les changements d'état
Expand All @@ -442,7 +442,7 @@ bool Ipx800::ISNewSwitch(const char *dev, const char *name, ISState *states, cha
// Si POWER_ON est activé
if (states[i] == ISS_ON)
{
IDMessage(getDeviceName(), "Roof Engine Power: ON");
IDMessage(getDeviceName(), "Roof Engine Power Management: ON");
roofEnginePowerS[0].s = ISS_ON;
roofEnginePowerS[1].s = ISS_OFF; // Désactive l'autre switch
roofPowerManagement = true;
Expand All @@ -453,7 +453,7 @@ bool Ipx800::ISNewSwitch(const char *dev, const char *name, ISState *states, cha
// Si POWER_OFF est activé
if (states[i] == ISS_ON)
{
IDMessage(getDeviceName(), "Roof Engine Power: OFF");
IDMessage(getDeviceName(), "Roof Engine Power Management: OFF");
roofEnginePowerS[0].s = ISS_OFF;
roofEnginePowerS[1].s = ISS_ON; // Désactive l'autre switch
roofPowerManagement = false;
Expand Down Expand Up @@ -526,15 +526,7 @@ bool Ipx800::ISNewSwitch(const char *dev, const char *name, ISState *states, cha
infoSet = true;
return true;
}
////////////////////////////////////////////////////
// Relay Action
////////////////////////////////////////////////////
if (!strcmp(name, RelaysStatesSP[i].name))
{
LOGF_DEBUG("Relay Modif : %d", i);
return true;
}


}

LOG_DEBUG("ISNewSwitch - First Init + UpDate");
Expand Down Expand Up @@ -1148,7 +1140,7 @@ bool Ipx800::UpdateDigitalOutputs()

//////////////////////////////////////
/* CommandOutput */
//
//
bool Ipx800::CommandOutput(uint32_t index, OutputState command)
{
//check index is controling enginepower
Expand All @@ -1163,9 +1155,7 @@ bool Ipx800::CommandOutput(uint32_t index, OutputState command)
rc = writeCommand(SetR, relayNumber);
else
rc = writeCommand(ClearR, relayNumber);

readAnswer();

return rc;
}

Expand Down
2 changes: 1 addition & 1 deletion indi_ipx800.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<devGroup group="Auxiliary">
<device label="IPX800" manufacturer="GCE">
<driver name="IPX800">indi_ipx800</driver>
<version>0.4</version>
<version>0.5</version>
</device>
</devGroup>
</driversList>

0 comments on commit 61134d5

Please sign in to comment.