From 13bbb5ffc430e7f90ff84380a7050d6eb313d615 Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Sun, 19 May 2024 01:33:11 +0200 Subject: [PATCH] use better names for constructing secondary entities --- gateway/include/ha.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gateway/include/ha.h b/gateway/include/ha.h index ef64de7..abec285 100644 --- a/gateway/include/ha.h +++ b/gateway/include/ha.h @@ -162,15 +162,14 @@ namespace Ha { return *this; } - Builder& withSecondary(Component* c) { + Builder& asSecondary(Component* c) { c->mainDevice = &DeviceConfig::create(cmp->id); return *this; } - Builder& withDiagnostic(Component* c) { + Builder& asDiagnostic(Component* c) { c->entityCategory = "diagnostic"; - c->mainDevice = &DeviceConfig::create(cmp->id); - return *this; + return asSecondary(c); } Builder& asDevice(DeviceConfig* deviceConfig) {