$sw = false;
if ($callback == 'Callback_vanna')
{
$sw = true;
cm("Relay17.switch");
}
if ($callback == 'Callback_kuhniy')
{
$sw = true;
cm("Relay11.switch");
}
if ($callback == 'Callback_frost')
{
$sw = true;
cm("Relay15.switch");
}
if ($callback == 'Callback_kofe')
{
$sw = true;
cm("Relay16.switch");
}
if ($callback == 'Callback_sasha')
{
$sw = true;
cm("Relay08.switch");
}
if ($callback == 'Callback_detskaia')
{
$sw = true;
cm("Relay05.switch");
}
if ($callback == 'Callback_zal')
{
$sw = true;
cm("Relay01.switch");
}
if ($callback == 'Callback_tv')
{
$sw = true;
cm("Relay02.switch");
}
if ($callback == 'Callback_stol')
{
$sw = true;
cm("Relay03.switch");
}
if ($sw)
{
$off = json_decode('"'.'\ud83c\udf11'.'"');
$on = json_decode('"'.'\uD83C\uDF15'.'"');
$k1 = $off;
$k2 = $off;
$k3 = $off;
$k4 = $off;
$k5 = $off;
$k6 = $off;
$k7 = $off;
$k8 = $off;
$k9 = $off;
if (gg("Relay17.status") == 1)
$k1 = $on;
if (gg("Relay11.status") == 1)
$k2 = $on;
if (gg("Relay15.status") == 1)
$k3 = $on;
if (gg("Relay16.status") == 1)
$k4 = $on;
if (gg("Relay08.status") == 1)
$k5 = $on;
if (gg("Relay05.status") == 1)
$k6 = $on;
if (gg("Relay01.status") == 1)
$k7 = $on;
if (gg("Relay02.status") == 1)
$k8 = $on;
if (gg("Relay03.status") == 1)
$k9 = $on;
$option[] = $this->buildInlineKeyboardButton($text=$k1."Ванная","","Callback_vanna","");
$option[] = $this->buildInlineKeyboardButton($text=$k2."Кухня","","Callback_kuhniy","");
$option[] = $this->buildInlineKeyboardButton($text=$k3."Frost","","Callback_frost","");
$option[] = $this->buildInlineKeyboardButton($text=$k4."Кофе","","Callback_kofe","");
$option[] = $this->buildInlineKeyboardButton($text=$k5."Саша","","Callback_sasha","");
$option[] = $this->buildInlineKeyboardButton($text=$k6."Дентская","","Callback_detskaia","");
$option[] = $this->buildInlineKeyboardButton($text=$k7."Зал","","Callback_zal","");
$option[] = $this->buildInlineKeyboardButton($text=$k8."TV","","Callback_tv","");
$option[] = $this->buildInlineKeyboardButton($text=$k9."Стол","","Callback_stol","");
$count_row = 3;
$option = array_chunk($option, $count_row);
$keyb = $this->buildInlineKeyBoard($option);
$this->editMessage($chat_id,$message_id,"Управление розетками:",$keyb);
}