adds check if extender set
This commit is contained in:
@@ -61,8 +61,12 @@ void LampFactory::set_address_pins()
|
|||||||
uint8_t LampFactory::get_address_pin(nlohmann::json & pin_object)
|
uint8_t LampFactory::get_address_pin(nlohmann::json & pin_object)
|
||||||
{
|
{
|
||||||
auto address = pin_object.at(config_path::item_address).get<uint8_t>();
|
auto address = pin_object.at(config_path::item_address).get<uint8_t>();
|
||||||
|
uint8_t pin_base = 0;
|
||||||
|
if (pin_object.find(config_path::item_extender) != pin_object.end())
|
||||||
|
{
|
||||||
auto extender = pin_object.at(config_path::item_extender).get<std::string>();
|
auto extender = pin_object.at(config_path::item_extender).get<std::string>();
|
||||||
auto pin_base = this->get_extender_pin_base(extender);
|
pin_base = this->get_extender_pin_base(extender);
|
||||||
|
}
|
||||||
|
|
||||||
return address + pin_base;
|
return address + pin_base;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user