Closed phoet closed 3 months ago
Hi @phoet,
thanks for the suggestion. I did play around with it and if you want you can give it a try:
gem 'fritzbox-smarthome', '~> 0.8.0', github: 'klausmeyer/fritzbox-smarthome', branch: 'feat/am-attributes'
nice, looks good, will try it soonish
@phoet friendly reminder ;)
ups, sorry. checked it out, works like a charm.
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'fritzbox-smarthome', '~> 0.8.0', github: 'klausmeyer/fritzbox-smarthome', branch: 'feat/am-attributes'
end
require 'fritzbox/smarthome'
ain = ARGV[0]
abort("AIN is required") if ain.nil?
Fritzbox::Smarthome.configure do |config|
config.endpoint = 'http://fritz.box'
config.username = 'evcc'
config.password = 'XXX'
config.verify_ssl = false
end
actor = Fritzbox::Smarthome::Actor.find_by!(ain: ain)
puts actor.attributes
Nice. Thanks for verifying.
I will publish a new version soon.
I was playing around with this gem for some home automation and it would be helpful for discoverability and ease of use to define the attributes in the Actor via
ActiveModel::Attributes
so that.attributes
.to_h
etc can be easily supported.