]> git.basschouten.com Git - openhab-addons.git/blob
8be1d6370adba1a3797aa0e6ddec1813e601b554
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.synopanalyzer.internal.synop;
14
15 /**
16  * The {@link WindDirections} enum possible overcast descriptions
17  *
18  * @author GaĆ«l L'hopital - Initial contribution
19  */
20 public enum Overcast {
21     UNDEFINED,
22     CLEAR_SKY,
23     CLOUDY,
24     SKY_NOT_VISIBLE;
25
26     /**
27      * Returns the overcast level depending upon octa
28      */
29     public static Overcast fromOcta(int octa) {
30         if (octa == 0) {
31             return Overcast.CLEAR_SKY;
32         } else if (octa > 0 && octa < 9) {
33             return Overcast.CLOUDY;
34         } else if (octa == 9) {
35             return Overcast.SKY_NOT_VISIBLE;
36         }
37         return Overcast.UNDEFINED;
38     }
39 }