Skip to content

Commit

Permalink
v1.2.35
Browse files Browse the repository at this point in the history
- Upgraded to PlatformIO 6.9.0
- Minor fixes for Arduino 3.x compatibility
- Added `System.DataSet` API to configure system data such as device name and default group name
  • Loading branch information
genemars committed Oct 9, 2024
1 parent bd18adf commit 24739ed
Show file tree
Hide file tree
Showing 46 changed files with 1,660 additions and 226 deletions.
89 changes: 0 additions & 89 deletions CMakeLists.txt

This file was deleted.

64 changes: 0 additions & 64 deletions CMakeListsPrivate.txt

This file was deleted.

43 changes: 26 additions & 17 deletions examples/color-light/color-light.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void setup() {

// Get the default system module
auto miniModule = homeGenie->getDefaultModule();
miniModule->name = "Smart light";
miniModule->name = "LED Controller";

// Add to the default module some configuration properties.
// Properties starting with `Widget.OptionField.` are special
Expand All @@ -48,14 +48,6 @@ void setup() {
miniModule->properties.add(
new ModuleParameter("Widget.OptionField.LED.power",
"number:LED.power:5:100:25:led_power"));
// Dropdown list control to select the light animation effect
miniModule->properties.add(
new ModuleParameter("Widget.OptionField.FX.Rainbow",
"select:FX.Style:light_style:solid|rainbow|rainbow_2|white_stripes|white_stripes_2|kaleidoscope"));
// Dropdown list control to enable the strobe effect
miniModule->properties.add(
new ModuleParameter("Widget.OptionField.FX.Strobe",
"select:FX.Strobe:strobe_effect:off|slow|medium|fast"));

// The following are the actual properties where
// UI controls implemented by `Widget.Options`
Expand All @@ -64,13 +56,10 @@ void setup() {
miniModule->properties.add(mpLedCount);
mpMaxPower = new ModuleParameter("LED.power", "25");
miniModule->properties.add(mpMaxPower);
mpFxStyle = new ModuleParameter("FX.Style", lightStyleNames[0]);
miniModule->properties.add(mpFxStyle);
mpFxStrobe = new ModuleParameter("FX.Strobe", "off");
miniModule->properties.add(mpFxStrobe);

// Get status LED config
int statusLedPin = Config::getSetting("stld-pin", "-1").toInt();
auto pin = Config::getSetting("stld-pin");
int statusLedPin = pin.isEmpty() ? -1 : pin.toInt();
if (statusLedPin >= 0) {
int statusLedType = Config::getSetting("stld-typ", "82").toInt();
int statusLedSpeed = Config::getSetting("stld-spd", "0").toInt();
Expand Down Expand Up @@ -105,12 +94,12 @@ void setup() {
maxPower = Config::getSetting("leds-pwr").toInt();
if (maxPower <= 0) maxPower = DEFAULT_MAX_POWER;
createPixels();

// default values
mpLedCount->value = String(ledsCount);
mpMaxPower->value = String(maxPower);

// Setup main LEDs control module
mainModule = new ColorLight(IO::IOEventDomains::HomeAutomation_HomeGenie, "C1", "Main");
mainModule = new ColorLight(IO::IOEventDomains::HomeAutomation_HomeGenie, "C1", "Color Light");
mainModule->module->properties.add(
new ModuleParameter("Widget.Preference.AudioLight", "true"));
mainModule->onSetColor([](LightColor color) {
Expand All @@ -119,8 +108,26 @@ void setup() {
});
homeGenie->addAPIHandler(mainModule);

auto module = mainModule->module;
module->name = "Smart Light";

// Add to the ColorLight module some configuration properties:
// - dropdown list control to select the light animation effect
module->properties.add(
new ModuleParameter("Widget.OptionField.FX.Rainbow",
"select:FX.Style:light_style:solid|rainbow|rainbow_2|white_stripes|white_stripes_2|kaleidoscope"));
// - dropdown list control to enable the strobe effect
module->properties.add(
new ModuleParameter("Widget.OptionField.FX.Strobe",
"select:FX.Strobe:strobe_effect:off|slow|medium|fast"));

mpFxStyle = new ModuleParameter("FX.Style", lightStyleNames[0]);
module->properties.add(mpFxStyle);
mpFxStrobe = new ModuleParameter("FX.Strobe", "off");
module->properties.add(mpFxStrobe);

// Setup control buttons
setupControlButtons(miniModule);
setupControlButtons(module);

// Initialize FX buffer
fx_init(ledsCount, currentColor);
Expand All @@ -133,6 +140,8 @@ void setup() {

}

// Name shown in SMNP/UPnP advertising
Config::system.friendlyName = "LED Controller";
homeGenie->begin();

refresh();
Expand Down
1 change: 1 addition & 0 deletions examples/ir-transceiver/ir-transceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void setup() {
homeGenie->addAPIHandler(colorLight);
#endif

Config::system.friendlyName = "Firefly IR";
homeGenie->begin();
}

Expand Down
1 change: 1 addition & 0 deletions examples/rf-transceiver/rf-transceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void setup() {
receiver->setModule(rfModule);
homeGenie->addIOHandler(receiver);

Config::system.friendlyName = "Firefly RF";
homeGenie->begin();

}
Expand Down
4 changes: 2 additions & 2 deletions examples/smart-sensor/CommonSensors.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ void includeCommonSensors(HomeGenie* homeGenie, Module* miniModule) {
if (Config::getSetting("sdht-typ").equals("22")) {
auto dhtSensor = new DHTxx(22, dhtSensorPint);
dhtSensor->setModule(miniModule);
homeGenie->addIOHandler(dhtSensor);
homeGenie->addIOHandler((IIOEventSender*)dhtSensor);
} else if (Config::getSetting("sdht-typ").equals("11")) {
auto dhtSensor = new DHTxx(11, dhtSensorPint);
dhtSensor->setModule(miniModule);
homeGenie->addIOHandler(dhtSensor);
homeGenie->addIOHandler((IIOEventSender*)dhtSensor);
}
}

Expand Down
1 change: 1 addition & 0 deletions examples/smart-sensor/smart-sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ void setup() {

includeCommonSensors(homeGenie, miniModule);

Config::system.friendlyName = "Smart Sensor";
homeGenie->begin();

}
Expand Down
1 change: 1 addition & 0 deletions examples/x10-transceiver/x10-transceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ void setup() {
x10Receiver->setModule(rfModule);
homeGenie->addIOHandler(x10Receiver);

Config::system.friendlyName = "Firefly X10";
homeGenie->begin();

}
Expand Down
2 changes: 1 addition & 1 deletion lib/ESP32_BleSerial/src/BleSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void BleSerial::onWrite(BLECharacteristic *pCharacteristic)
{
if (pCharacteristic->getUUID().toString() == BLE_RX_UUID)
{
std::string value = pCharacteristic->getValue();
std::string value = pCharacteristic->getValue().c_str();

for (int i = 0; i < value.length(); i++)
receiveBuffer.add(value[i]);
Expand Down
22 changes: 22 additions & 0 deletions lib/LinkedList/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
Loading

0 comments on commit 24739ed

Please sign in to comment.