Show entity page on main page

This commit is contained in:
Yegor Vialov
2019-10-28 17:59:47 +00:00
parent 327f623ef7
commit b34cc97080
24 changed files with 186 additions and 147 deletions

View File

@ -28,9 +28,9 @@ class _LightControlsWidgetState extends State<LightControlsWidget> {
setState(() {
_tmpBrightness = value.round();
_changedHere = true;
eventBus.fire(new ServiceCallEvent(
ConnectionManager().callService(
entity.domain, "turn_on", entity.entityId,
{"brightness": _tmpBrightness}));
{"brightness": _tmpBrightness});
});
}
@ -38,9 +38,9 @@ class _LightControlsWidgetState extends State<LightControlsWidget> {
setState(() {
_tmpWhiteValue = value.round();
_changedHere = true;
eventBus.fire(new ServiceCallEvent(
ConnectionManager().callService(
entity.domain, "turn_on", entity.entityId,
{"white_value": _tmpWhiteValue}));
{"white_value": _tmpWhiteValue});
});
}
@ -49,9 +49,9 @@ class _LightControlsWidgetState extends State<LightControlsWidget> {
setState(() {
_tmpColorTemp = value.round();
_changedHere = true;
eventBus.fire(new ServiceCallEvent(
ConnectionManager().callService(
entity.domain, "turn_on", entity.entityId,
{"color_temp": _tmpColorTemp}));
{"color_temp": _tmpColorTemp});
});
}
@ -60,9 +60,9 @@ class _LightControlsWidgetState extends State<LightControlsWidget> {
_tmpColor = color;
_changedHere = true;
Logger.d( "HS Color: [${color.hue}, ${color.saturation}]");
eventBus.fire(new ServiceCallEvent(
ConnectionManager().callService(
entity.domain, "turn_on", entity.entityId,
{"hs_color": [color.hue, color.saturation*100]}));
{"hs_color": [color.hue, color.saturation*100]});
});
}
@ -71,9 +71,9 @@ class _LightControlsWidgetState extends State<LightControlsWidget> {
_tmpEffect = value;
_changedHere = true;
if (_tmpEffect != null) {
eventBus.fire(new ServiceCallEvent(
ConnectionManager().callService(
entity.domain, "turn_on", entity.entityId,
{"effect": "$value"}));
{"effect": "$value"});
}
});
}