Fixes some issues with sounds and the appropriate factory. Further moved the calculation of pin addresses with pin base into the factories

This commit is contained in:
Johannes Wendel
2020-01-07 00:47:59 +01:00
parent 02709e650f
commit ee5a87ae15
18 changed files with 145 additions and 141 deletions

View File

@@ -28,7 +28,8 @@ std::map<std::string, std::shared_ptr<items::Lamp>> LampFactory::getItemMap()
auto address = lamp.at(config_path::item_address).get<uint8_t >();
auto extender = lamp.at(config_path::item_extender).get<std::string>();
auto pin_base = this->get_extender_pin_base(extender);
auto lamp_item = std::make_shared<items::detail::Lamp>(std::static_pointer_cast<DriverBoardPinController>(this->pin_controller), address, pin_base, name);
auto lamp_item = std::make_shared<items::detail::Lamp>(std::static_pointer_cast<DriverBoardPinController>(this->pin_controller), address + pin_base, name);
lamp_map.emplace(name, lamp_item);
}
return lamp_map;