Skip to content

Commit

Permalink
v1.2.50
Browse files Browse the repository at this point in the history
- fixed bug in MQTT broker when parsing long messages
- added missing MQTT broker code for complete integration with HomeGenie Server
- disabled unnecessary debug messages
- added support for Arduino Nano ESP32
  • Loading branch information
genemars committed Feb 19, 2025
1 parent 32efc89 commit 2fce300
Show file tree
Hide file tree
Showing 31 changed files with 312 additions and 212 deletions.
2 changes: 1 addition & 1 deletion examples/color-light/color-light.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ void setupControlButtons(Module* miniModule) {
}
auto btn2_pin = Config::getSetting("btn2-pin", "-1").toInt();
if (btn2_pin >= 0) {
auto button2 = new Button(IO::IOEventDomains::HomeAutomation_HomeGenie, "B1", "Button 1", btn2_pin);
auto button2 = new Button(IO::IOEventDomains::HomeAutomation_HomeGenie, "B2", "Button 2", btn2_pin);
button2->onSetStatus([](Service::API::devices::ButtonStatus status) {
if (status == BUTTON_STATUS_PRESSED) {
if (button1Pressed && (buttonCommand == BUTTON_COMMAND_NONE || buttonCommand == BUTTON_COMMAND_PRESET_COLORS)) {
Expand Down
20 changes: 18 additions & 2 deletions examples/smart-sensor-display/smart-sensor-display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,20 @@ ModuleParameter* controlModuleParameter = nullptr;

SwitchControlActivity* switchControl;


// UI options update listener
static class : public ModuleParameter::UpdateListener {
public:
void onUpdate(ModuleParameter* option) override {
Serial.println(option->value);
controlModuleUrl = option->value;
switchControl->setModuleUrl(controlModuleUrl);
Config::saveSetting("ctrl-mod", controlModuleUrl);
IO::Logger::info("Control module set to: %s", controlModuleUrl.c_str());
}
} optionUpdateListener;


Dashboard* dashboard;

void setup() {
Expand All @@ -69,6 +83,8 @@ void setup() {

homeGenie = HomeGenie::getInstance();
miniModule = homeGenie->getDefaultModule();
miniModule->setProperty(Implements::Scheduling, "true");
miniModule->setProperty(Implements::Scheduling_ModuleEvents, "true");

/*
// Init accel./gyro chip
Expand Down Expand Up @@ -109,15 +125,15 @@ void setup() {

miniModule->addWidgetOption(
// name, value
"RemoteControl.EndPoint", Config::getSetting("ctrl-mod").c_str(),
"RemoteControl.EndPoint", "",
// type
UI_WIDGETS_FIELD_TYPE_MODULE_TEXT
// options
":any"
":switch,light,dimmer,color,shutter"
":any"
":uri"
);
)->withConfigKey("ctrl-mod")->addUpdateListener(&optionUpdateListener);

// Add activities to UI

Expand Down
33 changes: 17 additions & 16 deletions examples/smart-sensor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,23 @@ A smart multi-sensor device.

In addition to default system options the following configuration options are available:

| Key | Description | Default |
|------------|--------------------------------------|-----------------------------------------|
| `stld-pin` | Status LED (RGB) pin | -1 (-1=not used) |
| `stld-typ` | Status LED type | RGB/RGBW order mask (see code for ref.) |
| `stld-spd` | Status LED speed | 0 (0=800kHz, 256=400kHz) |
| `ligh-typ` | Light sensor type | -1 |
| `ligh-pin` | Light sensor GPIO# | -1 |
| `motn-typ` | Motion sensor type | -1 |
| `motn-pin` | Motion sensor GPIO# | -1 |
| `soth-typ` | Temperature sensor type | -1 |
| `soth-pin` | Temperature sensor GPIO# | -1 |
| `sdht-typ` | Temperature + Humidity sensor type | -1 |
| `sdht-pin` | Temperature + Humidity sensor GPIO# | -1 |
| `colr-typ` | Color sensor type | -1 |
| `colr-sda` | Color sensor SDA pin | -1 |
| `colr-scl` | Color sensor SCL pin | -1 |
| Key | Description | Default |
|------------|---------------------------------------|-----------------------------------------|
| `stld-pin` | Status LED (RGB) pin | -1 (-1=not used) |
| `stld-typ` | Status LED type | RGB/RGBW order mask (see code for ref.) |
| `stld-spd` | Status LED speed | 0 (0=800kHz, 256=400kHz) |
| `ligh-typ` | Light sensor type | -1 |
| `ligh-pin` | Light sensor GPIO# | -1 |
| `motn-typ` | Motion sensor type | -1 |
| `motn-pin` | Motion sensor GPIO# | -1 |
| `soth-typ` | Temperature sensor type | -1 |
| `soth-pin` | Temperature sensor GPIO# | -1 |
| `sdht-typ` | Temperature + Humidity sensor type | -1 |
| `sdht-pin` | Temperature + Humidity sensor GPIO# | -1 |
| `sdht-adj` | Adjust temp. read value (-10 to +10) | 0 |
| `colr-typ` | Color sensor type | -1 |
| `colr-sda` | Color sensor SDA pin | -1 |
| `colr-scl` | Color sensor SCL pin | -1 |


### Manual build and install
Expand Down
Loading

0 comments on commit 2fce300

Please sign in to comment.