change device name to NukiHub

This commit is contained in:
technyon
2022-04-06 18:33:04 +02:00
parent e2cec0207d
commit 3959c9a559
3 changed files with 7 additions and 5 deletions

View File

@@ -4,8 +4,9 @@
NukiWrapper* nukiInst;
NukiWrapper::NukiWrapper(const std::string& name, uint32_t id, Network* network, Preferences* preferences)
: _nukiBle(name, id),
NukiWrapper::NukiWrapper(const std::string& deviceName, uint32_t id, Network* network, Preferences* preferences)
: _deviceName(deviceName),
_nukiBle(deviceName, id),
_network(network),
_preferences(preferences)
{
@@ -30,7 +31,7 @@ NukiWrapper::~NukiWrapper()
void NukiWrapper::initialize()
{
_bleScanner = new BleScanner();
_bleScanner->initialize();
_bleScanner->initialize(_deviceName);
_bleScanner->setScanDuration(10);
_nukiBle.initialize();
_nukiBle.registerBleScanner(_bleScanner);

View File

@@ -8,7 +8,7 @@
class NukiWrapper : public Nuki::SmartlockEventHandler
{
public:
NukiWrapper(const std::string& name, uint32_t id, Network* network, Preferences* preferences);
NukiWrapper(const std::string& deviceName, uint32_t id, Network* network, Preferences* preferences);
virtual ~NukiWrapper();
void initialize();
@@ -28,6 +28,7 @@ private:
Nuki::LockAction lockActionToEnum(const char* str); // char array at least 14 characters
std::string _deviceName;
Nuki::NukiBle _nukiBle;
BleScanner* _bleScanner;
Network* _network;

View File

@@ -74,7 +74,7 @@ void setup()
preferences->putUInt(preference_deviceId, deviceId);
}
nuki = new NukiWrapper("ESP", deviceId, network, preferences);
nuki = new NukiWrapper("NukiHub", deviceId, network, preferences);
webCfgServer = new WebCfgServer(nuki, network, preferences);
webCfgServer->initialize();
nuki->initialize();