homie_dart 1.0.0 copy "homie_dart: ^1.0.0" to clipboard
homie_dart: ^1.0.0 copied to clipboard

outdated

An implementation of the homie convention in dart.

example/example.dart

import 'package:homie_dart/homie_dart.dart';

import 'supercar.dart';
import 'printbroker.dart';

Future<Null> main(List<String> args) async {
  BrokerConnection con = new PrintBrokerConnection();
	await test(con);
}
	
Future<Null> test(BrokerConnection con) async{	
  qos=1;
  defaultIp = '192.168.178.171';
  defaultMac = '04:D3:B0:98:32:2B';

  SuperCar superCar = new SuperCar(deviceId: 'super-car');
  superCar.deviceStats.cpuTemperature = 48;
  superCar.deviceStats.signalStrength = 24;
  superCar.deviceStats.batterLevel = 80;

  print('Init...');
  await superCar.init(con);
  print('Updating engine temperature...');
  superCar.engineTemperature=32.5;
  print('Engine temperature: ${superCar.engineTemperature}');
}
1
likes
0
points
23
downloads

Publisher

verified publishereric-prokop-und-nils-wieler.de

Weekly Downloads

An implementation of the homie convention in dart.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta

More

Packages that depend on homie_dart