Skip to content

Maintenance counters and percents #39

@andrei-marinache

Description

@andrei-marinache

This is related to #13

I added code for maintenance percents and maintenance counters.
I've also added all the reported alarms (some are informations, some are alarms)
https://github.com/andrei-marinache/Jura-AlexxIT/releases/tag/v0.2

I like this way of filtering out invalid data for product counters:

        # remove aberrant values if any
        if total_count == 0 or total_count > 1000000:
            _LOGGER.info(
                f"total 0 or too high, something's wrong, returning existing statistics {self.statistics}"
            )
            return self.statistics

I did something similar for maintenance percents:

        maintenance_percents = {}
        for i in range(len(self.maintenance_percents)):
            value = decrypted_data[i]
            if 100 < value < 255:
                maintenance_percents = {}
                break
            if value <= 100:
                maintenance_percents[self.maintenance_percents[i]] = 100 - value
            elif value == 255:
                maintenance_percents[self.maintenance_percents[i]] = 100

QUESTION:
On my Z10, maintenance percents are only reported as increments of 10 (0%, 10%, 20%..).
Is this the same for all machines?
If yes, testing that all maintenance percent values are divisible by 10 would be a better choice.

I think that alarms should be OK.

What should we do with maintenance counters?
Should I also add them and check for an abnormal high value? If yes, what value?
For example my machine has made 778 drinks (677 coffees) and i have almost 1500 maintenance cycles (735 cappu rinse, 504 coffee rinse, 201 cappu clean)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions