Skip to content

Commit f8d4a0d

Browse files
committed
Fixed: Nest Protect (in combination with a thermostat) was not added to the system. Needed to change the DeviceID, so all current Nest Protects in the system will get a new ID
1 parent 125f4af commit f8d4a0d

File tree

5 files changed

+12
-10
lines changed

5 files changed

+12
-10
lines changed

hardware/Nest.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const std::string NEST_SET_SHARED = "/v2/put/shared.";
1919
const std::string NEST_SET_STRUCTURE = "/v2/put/structure.";
2020

2121
#ifdef _DEBUG
22-
//#define DEBUG_NextThermostatR
23-
//#define DEBUG_NextThermostatW
22+
#define DEBUG_NextThermostatR
23+
#define DEBUG_NextThermostatW
2424
#endif
2525

2626
#ifdef DEBUG_NextThermostatW
@@ -285,7 +285,7 @@ void CNest::UpdateSmokeSensor(const unsigned char Idx, const bool bOn, const std
285285
{
286286
bool bDeviceExits = true;
287287
char szIdx[10];
288-
sprintf(szIdx, "%X%02X%02X%02X", 0, 0, 0, Idx);
288+
sprintf(szIdx, "%X%02X%02X%02X", 0, 0, Idx, 0);
289289
std::vector<std::vector<std::string> > result;
290290
result = m_sql.safe_query("SELECT Name,nValue,sValue FROM DeviceStatus WHERE (HardwareID==%d) AND (DeviceID=='%q')", m_HwdID, szIdx);
291291
if (result.size() < 1)
@@ -310,8 +310,8 @@ void CNest::UpdateSmokeSensor(const unsigned char Idx, const bool bOn, const std
310310
lcmd.LIGHTING2.subtype = sTypeAC;
311311
lcmd.LIGHTING2.id1 = 0;
312312
lcmd.LIGHTING2.id2 = 0;
313-
lcmd.LIGHTING2.id3 = 0;
314-
lcmd.LIGHTING2.id4 = Idx;
313+
lcmd.LIGHTING2.id3 = Idx;
314+
lcmd.LIGHTING2.id4 = 0;
315315
lcmd.LIGHTING2.unitcode = 1;
316316
int level = 15;
317317
if (!bOn)
@@ -348,7 +348,7 @@ void CNest::GetMeterDetails()
348348
{
349349
std::string sResult;
350350
#ifdef DEBUG_NextThermostatR
351-
sResult = ReadFile("E:\\Nest_DoubleTherm.json");
351+
sResult = ReadFile("E:\\nest.json");
352352
#else
353353
if (m_UserName.size()==0)
354354
return;
@@ -604,14 +604,14 @@ void CNest::GetMeterDetails()
604604
if (nshared["can_heat"].asBool() && !nshared["hvac_heater_state"].empty())
605605
{
606606
bool bIsHeating = nshared["hvac_heater_state"].asBool();
607-
UpdateSwitch(113 + (iThermostat * 3), bIsHeating, Name + " HeatingOn");
607+
UpdateSwitch((unsigned char)(113 + (iThermostat * 3)), bIsHeating, Name + " HeatingOn");
608608
}
609609

610610
// Check if thermostat is currently Cooling
611611
if (nshared["can_cool"].asBool() && !nshared["hvac_ac_state"].empty())
612612
{
613613
bool bIsCooling = nshared["hvac_ac_state"].asBool();
614-
UpdateSwitch(114 + (iThermostat * 3), bIsCooling, Name + " CoolingOn");
614+
UpdateSwitch((unsigned char)(114 + (iThermostat * 3)), bIsCooling, Name + " CoolingOn");
615615
}
616616

617617
//Away

makebeta

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ then
3939
fi
4040
echo "Success, making beta...";
4141

42-
head -n1 appversion.h > ${version_file}
42+
cp -f appversion.h ${version_file}
4343
cp -f History.txt ${history_file}
4444

4545
# Generate the archive

makerelease

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ then
3939
fi
4040
echo "Success, making beta...";
4141

42-
head -n1 appversion.h > ${version_file}
42+
cp -f appversion.h ${version_file}
4343
cp -f History.txt ${history_file}
4444

4545
# Generate the archive

msbuild/domoticz.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,7 @@
12041204
<Image Include="..\www\styles\elemental\images\imgbg.jpg" />
12051205
</ItemGroup>
12061206
<ItemGroup>
1207+
<Text Include="..\History.txt" />
12071208
<Text Include="..\www\switch_icons.txt" />
12081209
<Text Include="..\www\templates\readme.txt" />
12091210
</ItemGroup>

msbuild/domoticz.vcxproj.filters

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3444,6 +3444,7 @@
34443444
<Text Include="..\www\templates\readme.txt">
34453445
<Filter>www\templates</Filter>
34463446
</Text>
3447+
<Text Include="..\History.txt" />
34473448
</ItemGroup>
34483449
<ItemGroup>
34493450
<Font Include="..\www\css\fonts\Oswald-Light.ttf">

0 commit comments

Comments
 (0)