<commit_before>/*******************************************************************************
 * Copyright (c) 2013 Whizzo Software, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package com.whizzosoftware.hobson.davisvantage;

import com.whizzosoftware.hobson.api.device.AbstractHobsonDevice;
import com.whizzosoftware.hobson.api.device.DeviceType;
import com.whizzosoftware.hobson.api.property.PropertyContainer;
import com.whizzosoftware.hobson.api.property.TypedProperty;
import com.whizzosoftware.hobson.api.variable.HobsonVariable;
import com.whizzosoftware.hobson.api.variable.VariableConstants;

/**
 * A Hobson device representing a Davis Vantage controller.
 *
 * @author <NAME>
 */
public class DavisVantageDevice extends AbstractHobsonDevice {

    public DavisVantageDevice(DavisVantagePlugin plugin, String id) {
        super(plugin, id);
        setDefaultName("Davis Vantage");
    }

    @Override
    public void onStartup(PropertyContainer config) {
        super.onStartup(config);

        // publish the appropriate variable
        publishVariable(VariableConstants.BAROMETRIC_PRESSURE_INHG, null, HobsonVariable.Mask.READ_ONLY);
        publishVariable(VariableConstants.DEW_PT_F, null, HobsonVariable.Mask.READ_ONLY);
        publishVariable(VariableConstants.FIRMWARE_VERSION, null, HobsonVariable.Mask.READ_ONLY);
        publishVariable(VariableConstants.INDOOR_RELATIVE_HUMIDITY, null, HobsonVariable.Mask.READ_ONLY);
        publishVariable(VariableConstants.INDOOR_TEMP_F, null, HobsonVariable.Mask.READ_ONLY);
        publishVariable(VariableConstants.OUTDOOR_TEMP_F, null, HobsonVariable.Mask.READ_ONLY);
        publishVariable(VariableConstants.OUTDOOR_RELATIVE_HUMIDITY, null, HobsonVariable.Mask.READ_ONLY);
        publishVariable(VariableConstants.WIND_DIRECTION_DEGREES, null, HobsonVariable.Mask.READ_ONLY);
        publishVariable(VariableConstants.WIND_SPEED_MPH, null, HobsonVariable.Mask.READ_ONLY);
    }

    @Override
    public void onShutdown() {
    }

    @Override
    public DeviceType getType() {
        return DeviceType.WEATHER_STATION;
    }<commit_msg>lastUpdate now required when publishing variables. Added sets to CollectionPersistenceContext. Refactored collection persistence to avoid key queries.<commit_after>/*******************************************************************************
 * Copyright (c) 2013 Whizzo Software, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package com.whizzosoftware.hobson.davisvantage;

import com.whizzosoftware.hobson.api.device.AbstractHobsonDevice;
import com.whizzosoftware.hobson.api.device.DeviceType;
import com.whizzosoftware.hobson.api.property.PropertyContainer;
import com.whizzosoftware.hobson.api.property.TypedProperty;
import com.whizzosoftware.hobson.api.variable.HobsonVariable;
import com.whizzosoftware.hobson.api.variable.VariableConstants;

/**
 * A Hobson device representing a Davis Vantage controller.
 *
 * @author <NAME>
 */
public class DavisVantageDevice extends AbstractHobsonDevice {

    public DavisVantageDevice(DavisVantagePlugin plugin, String id) {
        super(plugin, id);
        setDefaultName("Davis Vantage");
    }

    @Override
    public void onStartup(PropertyContainer config) {
        super.onStartup(config);

        // publish the appropriate variable
        publishVariable(VariableConstants.BAROMETRIC_PRESSURE_INHG, null, HobsonVariable.Mask.READ_ONLY, null);
        publishVariable(VariableConstants.DEW_PT_F, null, HobsonVariable.Mask.READ_ONLY, null);
        publishVariable(VariableConstants.FIRMWARE_VERSION, null, HobsonVariable.Mask.READ_ONLY, null);
        publishVariable(VariableConstants.INDOOR_RELATIVE_HUMIDITY, null, HobsonVariable.Mask.READ_ONLY, null);
        publishVariable(VariableConstants.INDOOR_TEMP_F, null, HobsonVariable.Mask.READ_ONLY, null);
        publishVariable(VariableConstants.OUTDOOR_TEMP_F, null, HobsonVariable.Mask.READ_ONLY, null);
        publishVariable(VariableConstants.OUTDOOR_RELATIVE_HUMIDITY, null, HobsonVariable.Mask.READ_ONLY, null);
        publishVariable(VariableConstants.WIND_DIRECTION_DEGREES, null, HobsonVariable.Mask.READ_ONLY, null);
        publishVariable(VariableConstants.WIND_SPEED_MPH, null, HobsonVariable.Mask.READ_ONLY, null);
    }

    @Override
    public void onShutdown() {
    }

    @Override
    public DeviceType getType() {
        return DeviceType.WEATHER_STATION;
    }
{'fraction_non_alphanumeric': 0.14094094094094095, 'fraction_numerical': 0.0032032032032032033, 'mean_word_length': 5.1001221001221, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6348703', 'n_tokens_mistral': 1429, 'n_tokens_neox': 1367, 'n_words': 269}