Module: Growatt

Extended by:
WrAPI::Configuration, WrAPI::RespondTo
Defined in:
lib/growatt.rb,
lib/growatt/api.rb,
lib/growatt/const.rb,
lib/growatt/error.rb,
lib/growatt/client.rb,
lib/growatt/version.rb,
lib/growatt/connection.rb,
lib/growatt/pagination.rb,
lib/growatt/authorization.rb

Defined Under Namespace

Modules: Authentication, Connection, RequestPagination Classes: API, AuthenticationError, Client, ConfigurationError, Enum, ExportLimit, GrowattError, Inverter, Timespan

Constant Summary collapse

DEFAULT_UA =
"Ruby Growatt API client #{Growatt::VERSION}".freeze
DEFAULT_ENDPOINT =

openapi.growatt.com/ is an option but does not work with my account

'https://server.growatt.com/'.freeze
DEFAULT_PAGINATION =
RequestPagination::DataPager
VERSION =
'0.2.0'

Class Method Summary collapse

Class Method Details

.client(options = {}) ⇒ Growatt::Client

Returns:



16
17
18
# File 'lib/growatt.rb', line 16

def self.client(options = {})
  Growatt::Client.new({ user_agent: DEFAULT_UA, endpoint: DEFAULT_ENDPOINT, pagination_class: DEFAULT_PAGINATION }.merge(options))
end

.resetObject



20
21
22
23
24
25
26
# File 'lib/growatt.rb', line 20

def self.reset
  super
  self.endpoint   = nil
  self.user_agent = DEFAULT_UA
  self.endpoint   = DEFAULT_ENDPOINT
  self.pagination_class = DEFAULT_PAGINATION
end