Skip to content

Commit

Permalink
Merge pull request #594 from iranl/hybrid-and-auth
Browse files Browse the repository at this point in the history
Various improvemnts and fixes
  • Loading branch information
iranl authored Jan 5, 2025
2 parents e1ca074 + fdef998 commit e1a12a5
Show file tree
Hide file tree
Showing 23 changed files with 545 additions and 395 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ In a browser navigate to the IP address assigned to the ESP32.
- Enable hybrid official MQTT and Nuki Hub setup: Enable to combine the official MQTT over Thread/Wi-Fi with BLE. Improves speed of state changes. Needs the official MQTT to be setup first. Also requires Nuki Hub to be paired as app and unregistered as a bridge using the Nuki app. See [hybrid mode](/HYBRID.md)
- Enable sending actions through official MQTT: Enable to sent lock actions through the official MQTT topics (e.g. over Thread/Wi-Fi) instead of using BLE. Needs "Enable hybrid official MQTT and Nuki Hub setup" to be enabled. See [hybrid mode](/HYBRID.md)
- Time between status updates when official MQTT is offline (seconds): Set to a positive integer to set the maximum amount of seconds between actively querying the Nuki lock for the current lock state when the official MQTT is offline, default 600.
- Retry command sent using official MQTT over BLE if failed: Enable to publish lock commands over BLE if NukiHub fails to use Hybrid mode to execute the command over MQTT
- Reboot Nuki lock on official MQTT failure: Enable to reboot the Nuki Lock if official MQTT over WiFi/Thread is offline for more than 180 seconds

### Nuki Configuration

Expand Down
2 changes: 1 addition & 1 deletion lib/nuki_ble
2 changes: 1 addition & 1 deletion src/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define NUKI_HUB_VERSION "9.07"
#define NUKI_HUB_VERSION_INT (uint32_t)907
#define NUKI_HUB_BUILD "unknownbuildnr"
#define NUKI_HUB_DATE "2025-01-04"
#define NUKI_HUB_DATE "2025-01-05"

#define GITHUB_LATEST_RELEASE_URL (char*)"https://github.com/technyon/nuki_hub/releases/latest"
#define GITHUB_OTA_MANIFEST_URL (char*)"https://raw.githubusercontent.com/technyon/nuki_hub/binary/ota/manifest.json"
Expand Down
14 changes: 7 additions & 7 deletions src/Gpio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void Gpio::loadPinConfiguration()
{
PinEntry entry;
entry.pin = serialized[i * 2];
Log->print(F("Pin "));
Log->print(("Pin "));
Log->println(entry.pin);

if(std::find(disabledPins.begin(), disabledPins.end(), entry.pin) == disabledPins.end())
Expand All @@ -227,14 +227,14 @@ void Gpio::loadPinConfiguration()
}
entry.role = (PinRole) serialized[(i * 2 + 1)];
Log->println("Not found in Ethernet disabled pins");
Log->print(F("Role: "));
Log->print(("Role: "));
Log->println(getRoleDescription(entry.role));
}
else
{
entry.role = PinRole::Ethernet;
Log->println("Found in Ethernet disabled pins");
Log->print(F("Role: "));
Log->print(("Role: "));
Log->println(getRoleDescription(entry.role));
}
if(entry.role != PinRole::Disabled)
Expand Down Expand Up @@ -331,7 +331,7 @@ const std::vector<int> Gpio::getDisabledPins() const
break;
}

Log->print(F("GPIO Ethernet disabled pins:"));
Log->print(("GPIO Ethernet disabled pins:"));
for_each_n(disabledPins.begin(), disabledPins.size(),
[](int x)
{
Expand All @@ -354,15 +354,15 @@ void Gpio::savePinConfiguration(const std::vector<PinEntry> &pinConfiguration)
for(int i=0; i < len; i++)
{
const auto& entry = pinConfiguration[i];
Log->print(F("Pin "));
Log->print(("Pin "));
Log->println(entry.pin);

if(std::find(disabledPins.begin(), disabledPins.end(), entry.pin) != disabledPins.end())
{
serialized[i * 2] = entry.pin;
serialized[i * 2 + 1] = (int8_t)PinRole::Ethernet;
Log->println("Found in Ethernet disabled pins");
Log->print(F("Role: "));
Log->print(("Role: "));
Log->println(getRoleDescription(PinRole::Ethernet));

}
Expand All @@ -373,7 +373,7 @@ void Gpio::savePinConfiguration(const std::vector<PinEntry> &pinConfiguration)
serialized[i * 2] = entry.pin;
serialized[i * 2 + 1] = (int8_t) entry.role;
Log->println("Not found in Ethernet disabled pins");
Log->print(F("Role: "));
Log->print(("Role: "));
Log->println(getRoleDescription(entry.role));
}
}
Expand Down
1 change: 1 addition & 0 deletions src/MqttTopics.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#define mqtt_topic_lock_binary_ring (char*)"/binaryRing"
#define mqtt_topic_lock_trigger (char*)"/trigger"
#define mqtt_topic_lock_last_lock_action (char*)"/lastLockAction"
#define mqtt_topic_lock_lock_action_context (char*)"/lockActionContext"
#define mqtt_topic_lock_log (char*)"/log"
#define mqtt_topic_lock_log_latest (char*)"/shortLog"
#define mqtt_topic_lock_log_rolling (char*)"/rollingLog"
Expand Down
Loading

0 comments on commit e1a12a5

Please sign in to comment.