public function getFrequency(): int
    {
        $data = $this->attributes["Recurrence"];
        if ($data === "ONCE") {
            return AlarmInterface::ONCE;
        }
        if ($data === "DAILY") {
            $data = "ON_0123456";
        } elseif ($data === "WEEKDAYS") {
            $data = "ON_12345";
        } elseif ($data === "WEEKENDS") {
            $data = "ON_06";
        }
        if (!preg_match("/^ON_([0-9]+)$/", $data, $matches)) {
            $error = "Unrecognised frequency for alarm ({$data}), please report this issue on github.com";
            throw new \RuntimeException($error);
        }

        $data = $matches[1];
        $days = 0;
        foreach ($this->days as $key => $val) {
            if (strpos($data, (string) $key) !== false) {
                $days = $days | $val;
            }
        }

        return $days;
    }