krioukov/LoCalProjects — Issue #1: Enphase sMAP Minor Bugs
Author: krioukov
Created: 2012-01-28 16:58:40+00:00
State: open

1) Lines 45,46:
I get a "smap.core.SmapException: set_metadata: values must be strings!" error from these lines because these parse as floats. Simple fix: str(entry['latitude']).

2) Line 72:
I get a "exceptions.KeyError: 'latest_time'" on this line. Prob need to add a latest_time = 0 key to entries when constructing.

3) Config File:
I didn't see one committed so I used the following:

```
[report 0]
ReportDeliveryLocation = http://new.openbms.org/backend/add/XXX

[/]
uuid = 6050b514-49cc-11e1-9675-eb8365a88b37
Metadata/SourceName = Enphase Solar

[/CA]
key = EnphaseBerkeley
type = enphase.EnphaseEnergy
City = Berkeley
State = CA
```

This works fine, but there is a problem when we want to add multiple cities. We can't have two /CA roots and there is no other way to specify multiple cities, because you automatically create the city sub-path. I suggest we either:
a) Allow users to specify a list of cities under each state (e.g. City = [Berkeley, Oakland]). You can assume the value of opt.City is a json string and parse accordingly.
or
b) Have the ini file specify the full path for each location and don't add any sub-paths. E.g:
[/CA/Berkeley]
type = enphase.EnphaseEnergy
City = Berkeley
State = CA
[/CA/Oakland]
type = enphase.EnphaseEnergy
City = Oakland
State = CA
This is a bit more verbose, but allows more flexible naming in the ini file.