<?xml version="1.0" encoding="UTF-8"?>

<!--
 
 OpenRemote, the Home of the Digital Home.
 Copyright 2008-2012, OpenRemote Inc.
 
 See the contributors.txt file in the distribution for a
 full listing of individual contributors.
 
 This is free software; you can redistribute it and/or modify it
 under the terms of the GNU General Public License as
 published by the Free Software Foundation; either version 3.0 of
 the License, or (at your option) any later version.
 
 This software is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 You should have received a copy of the GNU General Public
 License along with this software; if not, write to the Free
 Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 
 -->

<!--
 |  1-Wire protocol configuration for OpenRemote Designer.
 |
 |  Author: Jaroslav Misura
 +-->
<openremote xmlns="http://www.openremote.org"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.openremote.org protocol.xsd">
    
    <protocol displayName="1-Wire Protocol" tagName="onewire">
        
        <attr name="hostname" label="Hostname">
            <validations>
                <allowBlank>false</allowBlank>
                <regex message="Hostname or IP address">^((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])|(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9]))$</regex>
            </validations>
        </attr>
        
        <attr name="port" label="Port">
            <validations>
                <allowBlank>false</allowBlank>
                <maxLength>5</maxLength>
                <regex message="Port number, only numbers allowed">[0-9]{1,5}</regex>
            </validations>
        </attr>
        
        <attr name="deviceAddress" label="Device address">
            <validations>
                <allowBlank>false</allowBlank>
                <regex message="Device address format">.*</regex>
            </validations>
        </attr>
        
        <attr name="filename" label="Sensor attribute" >
            <validations>
                <allowBlank>false</allowBlank>
                <regex message="Sensor attribute, such as temperature or humidity">.*</regex>
            </validations>
        </attr>
        
	    <!--
	     |  Optional definition of the temperature scale to use. Default: Celsius
	     +-->
	    <attr name = "temperatureScale" label = "Temp. scale" options="Celsius,Fahrenheit,Kelvin,Rankine">
            <validations>
                <allowBlank>true</allowBlank>
            </validations>
	    </attr>
        
        <attr name="pollingInterval" label="Polling interval" tooltipMessage = "Polling interval in form of (1s, 1m, 1h) or just milliseconds">
            <validations>
                <allowBlank>false</allowBlank>
            </validations>
        </attr>
        
    </protocol>
</openremote>
