mirror of
https://github.com/thelsing/knx.git
synced 2025-01-30 00:19:01 +01:00
add float to knxValue
This commit is contained in:
parent
13b1cff315
commit
1e804d459e
@ -58,8 +58,10 @@ void setup(void)
|
|||||||
if(knx.configured())
|
if(knx.configured())
|
||||||
goTriggerSample.callback(triggerCallback);
|
goTriggerSample.callback(triggerCallback);
|
||||||
|
|
||||||
// depends on sensor board. Try BME680_I2C_ADDR_PRIMARY if it doen't work.
|
|
||||||
// Configure Wire pins before this call if needed.
|
// Configure Wire pins before this call if needed.
|
||||||
|
Wire.begin();
|
||||||
|
// depends on sensor board. Try BME680_I2C_ADDR_PRIMARY if it doen't work.
|
||||||
iaqSensor.begin(BME680_I2C_ADDR_SECONDARY, Wire);
|
iaqSensor.begin(BME680_I2C_ADDR_SECONDARY, Wire);
|
||||||
checkIaqSensorStatus();
|
checkIaqSensorStatus();
|
||||||
|
|
||||||
|
@ -529,3 +529,19 @@ struct tm KNXValue::timeValue() const
|
|||||||
struct tm tmp;
|
struct tm tmp;
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KNXValue::KNXValue(float value)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
KNXValue& KNXValue::operator=(const float value)
|
||||||
|
{
|
||||||
|
_value.doubleValue = value;
|
||||||
|
_type = DoubleType;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
KNXValue::operator float() const
|
||||||
|
{
|
||||||
|
return doubleValue();
|
||||||
|
}
|
@ -18,6 +18,7 @@ class KNXValue
|
|||||||
KNXValue(double value);
|
KNXValue(double value);
|
||||||
KNXValue(const char* value);
|
KNXValue(const char* value);
|
||||||
KNXValue(struct tm value);
|
KNXValue(struct tm value);
|
||||||
|
KNXValue(float value);
|
||||||
|
|
||||||
operator bool() const;
|
operator bool() const;
|
||||||
operator uint8_t() const;
|
operator uint8_t() const;
|
||||||
@ -31,6 +32,7 @@ class KNXValue
|
|||||||
operator double() const;
|
operator double() const;
|
||||||
operator const char*() const;
|
operator const char*() const;
|
||||||
operator struct tm() const;
|
operator struct tm() const;
|
||||||
|
operator float() const;
|
||||||
|
|
||||||
KNXValue& operator=(const bool value);
|
KNXValue& operator=(const bool value);
|
||||||
KNXValue& operator=(const uint8_t value);
|
KNXValue& operator=(const uint8_t value);
|
||||||
@ -44,6 +46,8 @@ class KNXValue
|
|||||||
KNXValue& operator=(const double value);
|
KNXValue& operator=(const double value);
|
||||||
KNXValue& operator=(const char* value);
|
KNXValue& operator=(const char* value);
|
||||||
KNXValue& operator=(const struct tm value);
|
KNXValue& operator=(const struct tm value);
|
||||||
|
KNXValue& operator=(const float value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
bool boolValue() const;
|
bool boolValue() const;
|
||||||
@ -88,7 +92,7 @@ class KNXValue
|
|||||||
LongType,
|
LongType,
|
||||||
DoubleType,
|
DoubleType,
|
||||||
StringType,
|
StringType,
|
||||||
TimeType
|
TimeType,
|
||||||
};
|
};
|
||||||
|
|
||||||
ValueType _type;
|
ValueType _type;
|
||||||
|
@ -224,6 +224,7 @@
|
|||||||
</DebugSettingsOverride>
|
</DebugSettingsOverride>
|
||||||
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.arduino.extension">
|
<BuildSettingsExtension xsi:type="com.visualgdb.build.external.arduino.extension">
|
||||||
<BoardID>esp8266:esp8266:nodemcuv2</BoardID>
|
<BoardID>esp8266:esp8266:nodemcuv2</BoardID>
|
||||||
|
<COMPort>COM4</COMPort>
|
||||||
<Properties>
|
<Properties>
|
||||||
<Entries>
|
<Entries>
|
||||||
<KeyValue>
|
<KeyValue>
|
||||||
@ -240,7 +241,7 @@
|
|||||||
</KeyValue>
|
</KeyValue>
|
||||||
<KeyValue>
|
<KeyValue>
|
||||||
<Key>ssl</Key>
|
<Key>ssl</Key>
|
||||||
<Value>all</Value>
|
<Value>basic</Value>
|
||||||
</KeyValue>
|
</KeyValue>
|
||||||
<KeyValue>
|
<KeyValue>
|
||||||
<Key>eesz</Key>
|
<Key>eesz</Key>
|
||||||
|
Loading…
Reference in New Issue
Block a user