パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.3.0

hue_dart

Flutterおよび/または AngularDartでPhilips Hueアプリを作成するためのライブラリ。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
31
いいね数
20
Pub ポイント
140

パッケージをインストール

flutter pub add hue_dart

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

hue_dart は、Flutter や AngularDart を使用して Philips Hue スマート照明システム向けのアプリケーションを開発できるようにする Dart ライブラリです。Hue ブリッジとやり取りするための明確で非同期な API を提供し、ライト、グループ、シーン、センサーの制御が可能になります。このパッケージはモバイル、ウェブ、デスクトップを含むすべての主要プラットフォームをサポートしており、クロスプラットフォーム IoT ソリューションに最適です。簡単な認証とデバイス管理により、ホームオートメーションアプリへの統合が容易になります。ライブラリは積極的にメンテナンスされており、ドキュメントも充実しているため、迅速な開発が可能です。

用途

  • スマートホーム照明制御
  • 自動照明シーン
  • IoTダッシュボード統合
  • ホームオートメーションワークフロー
  • リモートライト管理

主な機能

  • クロスプラットフォーム対応
  • 認証の処理
  • 軽量およびグループ管理
  • シーンとセンサーの相互作用
  • 非同期API設計

適している対象

  • Flutter開発者
  • AngularDart プロジェクト
  • IoTハッカー
  • ホームオートメーションアプリ
  • フルスタックウェブおよびモバイルアプリ

注意事項

  • Philips Hue ブリッジが必要です
  • Hue ブリッジへのネットワークアクセス
  • 認証の設定が必要です
  • フィリップスHueエコシステムに限定
  • 外部APIの安定性に依存

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

hue_dart

A library for creating Philips Hue apps in Flutter and/or AngularDart.

This library aims to make it easier to handle with the Philips Hue bridge.

Using

Discovery

Import the library and search for bridges.

import 'package:http/http.dart';
import 'package:hue_dart/hue_dart.dart';

final client = Client();
final discovery = BridgeDiscovery(client);

List<DiscoveryResult> discoverResults = await discovery.automatic();
final discoveryResult = discoverResults.first;

final bridge = Bridge(client, discoveryResult.ipAddress);

For web, use the BrowserClient.

import 'package:http/browser_client.dart';
import 'package:hue_dart/hue_dart.dart';

final client = BrowserClient();
final discovery = BridgeDiscovery(client);

List<DiscoveryResult> discoverResults = await discovery.automatic();
final discoveryResult = discoverResults.first;

final bridge = Bridge(client, discoveryResult.ipAddress);

Searching for a bridge by entering an IP address is also supported.

import package:hue_dart/hue.dart;

final client = Client();
final discovery = BridgeDiscovery(client);

DiscoveryResult discoverResult = await discovery.manual('192.168.1.2');

final bridge = Bridge(client, discoveryResult.ipAddress);
Create a new user

To create a user press the push link button before calling the createUser method

final bridge = Bridge(client, discoveryResult.ipAddress);
final whiteListItem = bridge.createUser('hue_dart');
bridge.username = whiteListItem.username;
Lights

To get the current lights on the bridge, create a Bridge, set a username and

final lights = bridge.lights();

Changing a light's color while respecting its current color mode is done by using the Light#changeColor method.

final light = lights.first.changeColor(red: 1.0, green: 0.5, blue: 1.0);
LightState state = lightStateForColorOnly(light);
await bridge.updateLightState(light.rebuild(
    (l) => l..state = state.toBuilder(),
));

Different light state attributes can also be changed.

final light = lights.first;
LightState state = LightState((s) => s
    ..brightness = 100,
);
await bridge.updateLightState(light.rebuild(
    (l) => l..state = state.toBuilder(),
));

To get the light's current color in rgb values (and other known means) use the Light#colors method

final light = lights.first;
HueColor colors = light.colors();
print('red:${colors.red}, green: ${colors.green}, blue:${colors.blue}');

カテゴリー

依存関係

依存関係一覧 4 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。