패키지, 저장소 및 앱 카테고리 검색

패키지 상세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 솔루션에 이상적입니다. 간단한 인증과 디바이스 관리 기능을 통해 홈 오토메이션 앱에의 통합을 용이하게 합니다. 라이브러리는 지속적으로 유지보수되고 잘 문서화되어 있어 빠른 개발을 가능하게 합니다.

사용 사례

  • 스마트 홈 조명 제어
  • 자동 조명 장면
  • 사물인터넷 대시보드 통합
  • 홈 자동화 워크플로우
  • 원격 조명 관리

주요 기능

  • 크로스 플랫폼 지원
  • 인증 처리
  • 경량 및 그룹 관리
  • 장면 및 센서 상호작용
  • 비동기 API 설계

적합한 대상

  • Flutter 개발자
  • AngularDart 프로젝트
  • 사물인터넷 애호가
  • 홈 오토메이션 앱
  • 풀스택 웹 및 모바일 앱

고려 사항

  • Philips 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 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.