implemented lamp
This commit is contained in:
@@ -169,6 +169,20 @@ std::shared_ptr<items::Solenoid> create_solenoid(nlohmann::json &solenoid_json,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<items::Lamp> create_lamp(nlohmann::json &lamp_json, std::shared_ptr<IOutputGPIOInterface> output_gpio_interface)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
std::string name = lamp_json.at("name");
|
||||||
|
uint8_t address = lamp_json.at("address").get<uint8_t>();
|
||||||
|
return std::make_shared<items::Lamp>(output_gpio_interface, address, name);
|
||||||
|
}
|
||||||
|
catch(json::type_error &e)
|
||||||
|
{
|
||||||
|
// todo log and exit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<items::Sound> create_sound(nlohmann::json &sound_json, std::shared_ptr<IOutputGPIOInterface> &output_gpio_interface, std::chrono::milliseconds deactivation_time)
|
std::shared_ptr<items::Sound> create_sound(nlohmann::json &sound_json, std::shared_ptr<IOutputGPIOInterface> &output_gpio_interface, std::chrono::milliseconds deactivation_time)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
Reference in New Issue
Block a user