<commit_before>"""
homeassistant.components.sensor.zwave
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Interfaces with Z-Wave sensors.
"""
# pylint: disable=import-error
from openzwave.network import ZWaveNetwork
from pydispatch import dispatcher

import homeassistant.components.zwave as zwave
from homeassistant.helpers.device import Device
from homeassistant.const import (
    ATTR_BATTERY_LEVEL, ATTR_UNIT_OF_MEASUREMENT, STATE_ON, STATE_OFF,
    TEMP_CELCIUS, TEMP_FAHRENHEIT, ATTR_LOCATION)


def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up Z-Wave sensors. """
    node = zwave.NETWORK.nodes[discovery_info[zwave.ATTR_NODE_ID]]
    value = node.values[discovery_info[zwave.ATTR_VALUE_ID]]

    value.set_change_verified(False)

    if zwave.NETWORK.controller.node_id not in node.groups[1].associations:
        node.groups[1].add_association(zwave.NETWORK.controller.node_id)

    if value.command_class == zwave.COMMAND_CLASS_SENSOR_BINARY:
        return [ZWaveBinarySensor(value)]

    elif value.command_class == zwave.COMMAND_CLASS_SENSOR_MULTILEVEL:
        return [ZWaveMultilevelSensor(value)]

<commit_msg>Z-Wave sensors no longer auto associate with controller<commit_after>"""
homeassistant.components.sensor.zwave
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Interfaces with Z-Wave sensors.
"""
# pylint: disable=import-error
from openzwave.network import ZWaveNetwork
from pydispatch import dispatcher

import homeassistant.components.zwave as zwave
from homeassistant.helpers.device import Device
from homeassistant.const import (
    ATTR_BATTERY_LEVEL, ATTR_UNIT_OF_MEASUREMENT, STATE_ON, STATE_OFF,
    TEMP_CELCIUS, TEMP_FAHRENHEIT, ATTR_LOCATION)


def setup_platform(hass, config, add_devices, discovery_info=None):
    """ Sets up Z-Wave sensors. """
    node = zwave.NETWORK.nodes[discovery_info[zwave.ATTR_NODE_ID]]
    value = node.values[discovery_info[zwave.ATTR_VALUE_ID]]

    value.set_change_verified(False)

    # if 1 in groups and (zwave.NETWORK.controller.node_id not in
    #                     groups[1].associations):
    #     node.groups[1].add_association(zwave.NETWORK.controller.node_id)

    if value.command_class == zwave.COMMAND_CLASS_SENSOR_BINARY:
        return [ZWaveBinarySensor(value)]

    elif value.command_class == zwave.COMMAND_CLASS_SENSOR_MULTILEVEL:
        return [ZWaveMultilevelSensor(value)]


{'fraction_non_alphanumeric': 0.11678526580159063, 'fraction_numerical': 0.002092925910422771, 'mean_word_length': 5.081424936386768, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5513023', 'n_tokens_mistral': 801, 'n_tokens_neox': 766, 'n_words': 139}