public function setFrequency(int $frequency): AlarmInterface
    {
        $recurrence = "ON_";
        foreach ($this->days as $key => $val) {
            if ($frequency & $val) {
                $recurrence .= $key;
            }
        }

        if ($recurrence === "ON_") {
            $recurrence = "ONCE";
        } elseif ($recurrence === "ON_0123456") {
            $recurrence = "DAILY";
        } elseif ($recurrence === "ON_01234") {
            $recurrence = "WEEKDAYS";
        } elseif ($recurrence === "ON_56") {
            $recurrence = "WEEKENDS";
        }

        $this->attributes["Recurrence"] = $recurrence;

        return $this->save();
    }