2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
14 package org.openhab.binding.nobohub.internal.model;
16 import static org.junit.jupiter.api.Assertions.assertEquals;
17 import static org.junit.jupiter.api.Assertions.assertTrue;
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.junit.jupiter.api.Test;
23 * Unit tests for Zone model object.
25 * @author Jørgen Austvik - Initial contribution
28 public class ZoneTest {
31 public void testParseH01Simple() throws NoboDataException {
32 Zone zone = Zone.fromH01("H01 1 1. etage 20 22 16 1 -1");
33 assertEquals(1, zone.getId());
34 assertEquals("1. etage", zone.getName());
35 assertEquals(20, zone.getActiveWeekProfileId());
36 assertTrue(zone.getAllowOverrides());
37 assertEquals(16, zone.getEcoTemperature());
38 assertEquals(22, zone.getComfortTemperature());
42 public void testGenerateCommand() throws NoboDataException {
43 Zone zone = Zone.fromH01("H01 1 1. etage 20 22 16 1 -1");
44 assertEquals("U00 1 1. etage 20 22 16 1 -1", zone.generateCommandString("U00"));