Class: MyTado::Client
- Inherits:
-
Object
- Object
- MyTado::Client
- Defined in:
- lib/my_tado/client.rb
Overview
The main object from where everything else happens
Constant Summary collapse
- IMPLEMENTED_ENDPOINTS =
%i[me day_report home presence weather zones zone_state].freeze
Instance Method Summary collapse
- #access_token ⇒ Object
- #credentials ⇒ Object
- #home_id ⇒ Object
-
#initialize(credentials_source) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(credentials_source) ⇒ Client
Returns a new instance of Client.
10 11 12 |
# File 'lib/my_tado/client.rb', line 10 def initialize(credentials_source) @credentials_source = credentials_source end |
Instance Method Details
#access_token ⇒ Object
18 19 20 |
# File 'lib/my_tado/client.rb', line 18 def access_token oauth_client.access_token end |
#credentials ⇒ Object
14 15 16 |
# File 'lib/my_tado/client.rb', line 14 def credentials @credentials ||= CredentialGetter.new(@credentials_source) end |
#home_id ⇒ Object
22 23 24 |
# File 'lib/my_tado/client.rb', line 22 def home_id @home_id ||= credentials.home_id || me["homeId"] end |