show keypad and door sensor in sysinfo page

This commit is contained in:
technyon
2023-03-11 18:09:42 +01:00
parent b3fcca74b5
commit c0a2a69d08
6 changed files with 17 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
#pragma once #pragma once
#define NUKI_HUB_VERSION "8.18-pre-1" #define NUKI_HUB_VERSION "8.18-pre-3"
#define MQTT_QOS_LEVEL 1 #define MQTT_QOS_LEVEL 1
#define MQTT_CLEAN_SESSIONS false #define MQTT_CLEAN_SESSIONS false

View File

@@ -589,12 +589,12 @@ const NukiOpener::OpenerState &NukiOpenerWrapper::keyTurnerState()
return _keyTurnerState; return _keyTurnerState;
} }
const bool NukiOpenerWrapper::isPaired() const bool NukiOpenerWrapper::isPaired() const
{ {
return _paired; return _paired;
} }
const bool NukiOpenerWrapper::hasKeypad() const bool NukiOpenerWrapper::hasKeypad() const
{ {
return _hasKeypad; return _hasKeypad;
} }

View File

@@ -25,8 +25,8 @@ public:
void disableWatchdog(); void disableWatchdog();
const NukiOpener::OpenerState& keyTurnerState(); const NukiOpener::OpenerState& keyTurnerState();
const bool isPaired(); const bool isPaired() const;
const bool hasKeypad(); const bool hasKeypad() const;
const BLEAddress getBleAddress() const; const BLEAddress getBleAddress() const;
std::string firmwareVersion() const; std::string firmwareVersion() const;

View File

@@ -615,12 +615,12 @@ const NukiLock::KeyTurnerState &NukiWrapper::keyTurnerState()
return _keyTurnerState; return _keyTurnerState;
} }
const bool NukiWrapper::isPaired() const bool NukiWrapper::isPaired() const
{ {
return _paired; return _paired;
} }
const bool NukiWrapper::hasKeypad() const bool NukiWrapper::hasKeypad() const
{ {
return _hasKeypad; return _hasKeypad;
} }
@@ -667,7 +667,7 @@ void NukiWrapper::setupHASS()
Log->println("HASS setup for lock completed."); Log->println("HASS setup for lock completed.");
} }
bool NukiWrapper::hasDoorSensor() bool NukiWrapper::hasDoorSensor() const
{ {
return _keyTurnerState.doorSensorState == Nuki::DoorSensorState::DoorClosed || return _keyTurnerState.doorSensorState == Nuki::DoorSensorState::DoorClosed ||
_keyTurnerState.doorSensorState == Nuki::DoorSensorState::DoorOpened || _keyTurnerState.doorSensorState == Nuki::DoorSensorState::DoorOpened ||

View File

@@ -28,8 +28,9 @@ public:
void disableWatchdog(); void disableWatchdog();
const NukiLock::KeyTurnerState& keyTurnerState(); const NukiLock::KeyTurnerState& keyTurnerState();
const bool isPaired(); const bool isPaired() const;
const bool hasKeypad(); const bool hasKeypad() const;
bool hasDoorSensor() const;
const BLEAddress getBleAddress() const; const BLEAddress getBleAddress() const;
std::string firmwareVersion() const; std::string firmwareVersion() const;
@@ -55,7 +56,6 @@ private:
void readAdvancedConfig(); void readAdvancedConfig();
void setupHASS(); void setupHASS();
bool hasDoorSensor();
void printCommandResult(Nuki::CmdResult result); void printCommandResult(Nuki::CmdResult result);

View File

@@ -808,6 +808,10 @@ void WebCfgServer::buildInfoHtml(String &response)
response.concat(_nuki->isPaired() ? "Yes\n" : "No\n"); response.concat(_nuki->isPaired() ? "Yes\n" : "No\n");
response.concat("Lock PIN set: "); response.concat("Lock PIN set: ");
response.concat(_nuki->isPaired() ? _nuki->isPinSet() ? "Yes\n" : "No\n" : "-\n"); response.concat(_nuki->isPaired() ? _nuki->isPinSet() ? "Yes\n" : "No\n" : "-\n");
response.concat("Lock has door sensor: ");
response.concat(_nuki->hasDoorSensor() ? "Yes\n" : "No\n");
response.concat("Lock has keypad: ");
response.concat(_nuki->hasKeypad() ? "Yes\n" : "No\n");
} }
if(_nukiOpener != nullptr) if(_nukiOpener != nullptr)
{ {
@@ -818,6 +822,8 @@ void WebCfgServer::buildInfoHtml(String &response)
response.concat(_nukiOpener->isPaired() ? "Yes\n" : "No\n"); response.concat(_nukiOpener->isPaired() ? "Yes\n" : "No\n");
response.concat("Opener PIN set: "); response.concat("Opener PIN set: ");
response.concat(_nukiOpener->isPaired() ? _nukiOpener->isPinSet() ? "Yes\n" : "No\n" : "-\n"); response.concat(_nukiOpener->isPaired() ? _nukiOpener->isPinSet() ? "Yes\n" : "No\n" : "-\n");
response.concat("Opener has keypad: ");
response.concat(_nukiOpener->hasKeypad() ? "Yes\n" : "No\n");
} }
response.concat("Network device: "); response.concat("Network device: ");