Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check whether gas readings are optional #34

Closed
dennissiemensma opened this issue Feb 4, 2016 · 10 comments
Closed

Check whether gas readings are optional #34

dennissiemensma opened this issue Feb 4, 2016 · 10 comments
Assignees
Milestone

Comments

@dennissiemensma
Copy link
Member

Because sometimes there is simply no gas meter attached to the dsmr device.

Possibly affects:

  • Mandatory database fields
  • Compactor services
  • Temperature readings hook.
  • Frontend interface
@dennissiemensma
Copy link
Member Author

Original comment by Dennis Siemensma (Bitbucket: dennissiemensma, GitHub: dennissiemensma):


DsmrReading 's extra_device_timestamp & extra_device_delivered should be nullable.

@dennissiemensma
Copy link
Member Author

This issue is required for @danielterhorst as he does not have a meter which supports gas readings.

@dennissiemensma
Copy link
Member Author

@danielterhorst heb je toevallig een snapshot van je DSMR telegram?

Of mis je gewoon deze velden onderaan?

0-1:24.1.0(003)
0-1:96.1.0(xxxxxx-lang-id-van-meter-xxxxxxxxxxxxxxxxxx)
0-1:24.2.1(160229190000W)(01234.567*m3)

@dennissiemensma
Copy link
Member Author

Altered database to allow nullable extra devices. Tests work fine now, after defaulting some values to None:

        if with_gas:
            data += [
                "0-1:24.1.0(003)\n",
                "0-1:96.1.0(xxxxxxxxxxxxx)\n",
                "0-1:24.2.1(151110190000W)(00845.206*m3)\n",
                "0-1:24.4.0(1)\n",
            ]

Next up are all the services expecting to have at least gas consumption tracked.

@dennissiemensma
Copy link
Member Author

Refactored the tests a bit. Created separate fixtures without gas data, sub classed the tests and altered the fixtures, having them execute the same tests, with different data.

Any code depending on gas readings came forward. Although it's all just based on asumptions without a production example.

@dennissiemensma
Copy link
Member Author

Added some checks to interface. Will continue later. Merged to default for now.

@dennissiemensma
Copy link
Member Author

Flushing the database for checking whether the views run without data does not work for postgresql and mysql. I'll have to refactor that later, by just calling the model's .objects.all().delete() instead of call_command.

@dennissiemensma
Copy link
Member Author

Fixed tests, as they failed for mysql & postgres when calling flush, which wrapped an transaction inside another transaction and failed.

@dennissiemensma
Copy link
Member Author

As the gas is now optional, technically, I think I'll close this one and have #70 as followup. Which points to the actual interface and capabilities regarding gas & electricity returned.

@dennissiemensma
Copy link
Member Author

./test-all.sh once again passes the tests for all backends supported.

Merged & deployed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant