<commit_before>#!/usr/bin/env ruby

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'zwave'

zwave = ZWave::SerialAPI.new ARGV[0]
zwave.debug = true
zwave.switch(ARGV[1].to_i).switch_off
sleep 2
zwave.switch(ARGV[1].to_i).switch_on<commit_msg>Adding some status print-outs during the switch example.<commit_after>#!/usr/bin/env ruby

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'zwave'

zwave = ZWave::SerialAPI.new ARGV[0]
unit_id = ARGV[1].to_i
zwave.debug = true

zwave.switch(unit_id).switch_off
sleep 0.5
p zwave.get(unit_id, ZWave::SerialAPI::Constants::CommandClass::SWITCH_BINARY)

sleep 2

zwave.switch(unit_id).switch_on
sleep 0.5
p zwave.get(unit_id, ZWave::SerialAPI::Constants::CommandClass::SWITCH_BINARY)
{'fraction_non_alphanumeric': 0.16174582798459564, 'fraction_numerical': 0.014120667522464698, 'mean_word_length': 6.7227722772277225, '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': '5767592', 'n_tokens_mistral': 326, 'n_tokens_neox': 307, 'n_words': 48}