smartermeter 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.2 (February 9, 2012)
4
+ * Fixed an issue with uploading data to pachube.
5
+ * Fixed README to accurately reflect the new API.
6
+ * Save files with the proper extension (ESPI)
7
+
3
8
  ## 0.4.1 (February 5, 2012)
4
9
  * Fixed an issue with downloading multiple days at the same time.
5
10
  * Fixed an issue with detecting incomplete data.
data/README.md CHANGED
@@ -27,7 +27,7 @@ to manipulate it using ruby like so:
27
27
  config = YAML.load_file(File.expand_path("~/.smartermeter"))
28
28
  csv_file = Dir.glob(File.join(config[:data_dir], "*.csv")).last
29
29
 
30
- samples = SmarterMeter::Samples.parse_csv(csv_file)
30
+ samples = SmarterMeter::Samples.parse_espi(csv_file)
31
31
  kwh_used = samples.total_kwh
32
32
  api = SmarterMeter::Services::BrighterPlanet.new
33
33
  puts api.calculate_kg_carbon(kwh_used)
@@ -48,11 +48,13 @@ Pachube, so you can visualize the results.
48
48
  1. Then append the following to your ~/.smartermeter file to
49
49
  automatically upload data as it's retrieved from PG&E.
50
50
 
51
- :transport: :pachube
52
- :pachube:
53
- :api_key: "your-api-key"
54
- :feed_id: "your-feed-id"
55
- :datastream_id: "your-datastream-id"
51
+ ```
52
+ :transport: :pachube
53
+ :pachube:
54
+ :api_key: "your-api-key"
55
+ :feed_id: "your-feed-id"
56
+ :datastream_id: "your-datastream-id"
57
+ ```
56
58
 
57
59
  To Build the Windows Installer
58
60
  --------
@@ -31,7 +31,7 @@ module SmarterMeter
31
31
 
32
32
  # Returns a filename for the data belonging to the given date.
33
33
  def data_file(date)
34
- File.expand_path(File.join(@config[:data_dir], date.strftime("%Y-%m-%d.csv")))
34
+ File.expand_path(File.join(@config[:data_dir], date.strftime("%Y-%m-%d.espi")))
35
35
  end
36
36
 
37
37
  # Loads the configuration and prompts for required settings if they are
@@ -182,7 +182,7 @@ module SmarterMeter
182
182
  next if data.empty?
183
183
 
184
184
  @ui.log.info("Verifying #{date}")
185
- samples = Samples.parse_espi(data).values
185
+ samples = Samples.parse_espi(data)
186
186
 
187
187
  if samples.any?
188
188
  @ui.log.info("Saving #{date}")
@@ -191,7 +191,7 @@ module SmarterMeter
191
191
  f.write(data)
192
192
  end
193
193
 
194
- upload(date, samples)
194
+ upload(date, samples[date])
195
195
 
196
196
  @ui.log.info("Completed #{date}")
197
197
  completed << date
@@ -220,7 +220,7 @@ module SmarterMeter
220
220
  # Returns an Array of Date objects containing all dates since start_date
221
221
  # missing power data.
222
222
  def dates_requiring_data
223
- collected = Dir.glob(File.join(@config[:data_dir], "*-*-*.csv")).map { |f| File.basename(f, ".csv") }
223
+ collected = Dir.glob(File.join(@config[:data_dir], "*-*-*.{csv,espi}")).map { |f| File.basename(f).split(".")[0] }
224
224
  all_days = []
225
225
 
226
226
  count_of_days = (Date.today - @config[:start_date]).to_i
data/lib/smartermeter.rb CHANGED
@@ -7,5 +7,5 @@ require 'smartermeter/services/brighterplanet'
7
7
  require 'smartermeter/interfaces/cli'
8
8
 
9
9
  module SmarterMeter
10
- VERSION = "0.4.1"
10
+ VERSION = "0.4.2"
11
11
  end
data/smartermeter.gemspec CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'smartermeter'
16
- s.version = '0.4.1'
17
- s.date = '2012-02-05'
16
+ s.version = '0.4.2'
17
+ s.date = '2012-02-09'
18
18
  s.rubyforge_project = 'smartermeter'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smartermeter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-05 00:00:00.000000000 Z
12
+ date: 2012-02-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mechanize
16
- requirement: &70154877461120 !ruby/object:Gem::Requirement
16
+ requirement: &70173616966840 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.0.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70154877461120
24
+ version_requirements: *70173616966840
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: crypt19
27
- requirement: &70154877459980 !ruby/object:Gem::Requirement
27
+ requirement: &70173616966100 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - =
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.2.1
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70154877459980
35
+ version_requirements: *70173616966100
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rest-client
38
- requirement: &70154877458400 !ruby/object:Gem::Requirement
38
+ requirement: &70173616965140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - =
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 1.6.1
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70154877458400
46
+ version_requirements: *70173616965140
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: json_pure
49
- requirement: &70154877516580 !ruby/object:Gem::Requirement
49
+ requirement: &70173616963860 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - =
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: 1.5.1
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70154877516580
57
+ version_requirements: *70173616963860
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rubyzip
60
- requirement: &70154877516080 !ruby/object:Gem::Requirement
60
+ requirement: &70173616962780 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - =
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 0.9.5
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *70154877516080
68
+ version_requirements: *70173616962780
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
- requirement: &70154877515320 !ruby/object:Gem::Requirement
71
+ requirement: &70173616961300 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: 2.8.0
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70154877515320
79
+ version_requirements: *70173616961300
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: vcr
82
- requirement: &70154877514600 !ruby/object:Gem::Requirement
82
+ requirement: &70173616976880 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,10 +87,10 @@ dependencies:
87
87
  version: 1.11.3
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *70154877514600
90
+ version_requirements: *70173616976880
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: webmock
93
- requirement: &70154877514060 !ruby/object:Gem::Requirement
93
+ requirement: &70173616976160 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ~>
@@ -98,10 +98,10 @@ dependencies:
98
98
  version: 1.7.10
99
99
  type: :development
100
100
  prerelease: false
101
- version_requirements: *70154877514060
101
+ version_requirements: *70173616976160
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: minitar
104
- requirement: &70154877513500 !ruby/object:Gem::Requirement
104
+ requirement: &70173616975180 !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements:
107
107
  - - ~>
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: 0.5.2
110
110
  type: :development
111
111
  prerelease: false
112
- version_requirements: *70154877513500
112
+ version_requirements: *70173616975180
113
113
  description: Fetches SmartMeter data from PG&E and can upload to Pachube
114
114
  email: matt.removethis@nospam.colyer.name
115
115
  executables: