state, ['on', 'home', 'open', 'unlocked', 'active'], true); } public function isOff(): bool { return in_array($this->state, ['off', 'away', 'closed', 'locked', 'inactive'], true); } public function getDomain(): string { $parts = explode('.', $this->entityId, 2); return $parts[0]; } public function getName(): string { return $this->attributes['friendly_name'] ?? $this->entityId; } }