RAD Studio Quickly Control Light Bulbs Using FireMonkey

FireWind

Свой
Регистрация
2 Дек 2005
Сообщения
1,957
Реакции
1,199
Credits
4,009
Quickly Control Light Bulbs Using FireMonkey
By Muminjon March 26, 2021

ThingConnect IoT device component pack is one of the best areas of RAD Studio. It offers you to connect to dozens of IoT devices with easy-to-use interfaces. For instance, you can connect to the Aeon Labs Light Bulb using Delphi or C++ Builder.

1616831273649.png
As you can see these light bulbs can be controlled by other devices. You can schedule events using your FireMonkey based mobile app.
1616831285892.png
Код:
procedure TAeotecLEDBulbApp.ReadBtn1Click(Sender: TObject);
var
  Value: String;
begin
  Memo1.Text := '';
  if ComboBox1.ListItems[0].IsSelected then
  begin
    Value := FVeraAeotecLEDBulb.DeviceName;
    Memo1.Text := Value;
  end
  else if ComboBox1.ListItems[1].IsSelected then
  begin
    Value := FVeraAeotecLEDBulb.ManufacturerName;
    Memo1.Text := Value;
  end
  else if ComboBox1.ListItems[2].IsSelected then
  begin
    Value := FVeraAeotecLEDBulb.ModelName;
    Memo1.Text := Value;
    if Memo1.Text = '' then
      Memo1.Text := 'Not exist';
  end
  else if ComboBox1.ListItems[3].IsSelected then
  begin
    Value := IntToStr(FVeraAeotecLEDBulb.DeviceID);
    Memo1.Text := Value;
  end
  else if ComboBox1.ListItems[4].IsSelected then
  begin
    Value := IntToStr(FVeraAeotecLEDBulb.PnPID);
    Memo1.Text := Value;
  end;
end;
Для просмотра ссылки Войди или Зарегистрируйся