Fix service calls
This commit is contained in:
parent
f9f013636d
commit
bcd175fbfb
@ -348,15 +348,16 @@ class ConnectionManager {
|
|||||||
_currentMessageId += 1;
|
_currentMessageId += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Future callService(String domain, String service, String entityId, Map serviceData) {
|
Future callService(String domain, String service, String entityId, Map additionalServiceData) {
|
||||||
eventBus.fire(NotifyServiceCallEvent(domain, service, entityId));
|
eventBus.fire(NotifyServiceCallEvent(domain, service, entityId));
|
||||||
|
Logger.d("[callService] $domain.$service $entityId $additionalServiceData");
|
||||||
Completer completer = Completer();
|
Completer completer = Completer();
|
||||||
Map serviceData = {};
|
Map serviceData = {};
|
||||||
if (entityId != null) {
|
if (entityId != null) {
|
||||||
serviceData["entity_id"] = entityId;
|
serviceData["entity_id"] = entityId;
|
||||||
}
|
}
|
||||||
if (serviceData != null && serviceData.isNotEmpty) {
|
if (additionalServiceData != null && additionalServiceData.isNotEmpty) {
|
||||||
serviceData.addAll(serviceData);
|
serviceData.addAll(additionalServiceData);
|
||||||
}
|
}
|
||||||
if (serviceData.isNotEmpty)
|
if (serviceData.isNotEmpty)
|
||||||
sendHTTPPost(
|
sendHTTPPost(
|
||||||
|
Reference in New Issue
Block a user