Add GPIO for network connected status (#700)
* Add gpio output if mqtt connected * Add gpio output for network connected status
This commit is contained in:
@@ -38,6 +38,7 @@ NukiNetwork::NukiNetwork(Preferences *preferences)
|
||||
_inst = this;
|
||||
#ifndef NUKI_HUB_UPDATER
|
||||
_pinsMqttConnected = _gpio->getPinsWithRole(PinRole::OutputHighMqttConnected);
|
||||
_pinsNetworkConnected = _gpio->getPinsWithRole(PinRole::OutputHighNetworkConnected);
|
||||
#endif
|
||||
setupDevice();
|
||||
}
|
||||
@@ -682,11 +683,16 @@ bool NukiNetwork::update()
|
||||
void NukiNetwork::updateNetworkStatusLeds()
|
||||
{
|
||||
bool mqttConnected = _device->mqttConnected();
|
||||
bool networkConnected = _device->isConnected();
|
||||
|
||||
for (uint8_t pin : _pinsMqttConnected)
|
||||
{
|
||||
_gpio->setPinOutput(pin, mqttConnected ? HIGH : LOW);
|
||||
}
|
||||
for (uint8_t pin : _pinsNetworkConnected)
|
||||
{
|
||||
_gpio->setPinOutput(pin, networkConnected ? HIGH : LOW);
|
||||
}
|
||||
}
|
||||
|
||||
void NukiNetwork::checkInternetConnectivity()
|
||||
|
||||
Reference in New Issue
Block a user