Open nicolastarzia opened 6 years ago
It will be nice if the speed lower than 10% that user contract, send an twitter to @anatel.
It will be nice, but including ANATEL in the logic of the program is something I strongly disagree. As I've just said in #8:
MINIMUM_SPEED
) and not only when it disrespects too much (because too much is too subjective indeed).As I also said there, using general concepts such asMINIMUM_SPEED
make the project independent of ANATEL or any country-specific regulations, making it reasonable for most countries of the world I guess. I think if anyone likes this feature we could differ between just below the minimum speed and critical speed, keeping configuration out of code:
CRITICAL_SPEED
envvar that defaults to MINIMUM_SPEED
CRITICAL_TWEET
envvar that defaults to TWEET
tweet
method we decide if we use minimum or critical if
s and tweet messages. I discuss it further (and some better concepts for implementation) in #7 though.
Perfect, and I agree with you, it's wrong if include ANATEL in the logic.
To solve this "problem" what do you think if we change the MINIMUM_SPEED and TWEET to a list of key/value (I think in python it's tuples)? So we can configure N messages according the speed, turning this robot a little bit more dynamic.
Config Scenario:
Config minimum speed (thresold) | Message |
---|---|
10 | My internet is terrible, only {real_speed}. I contract {contract_speed}, what do you think @MyISP? |
40 | Hey @MyISP, I think that something wrong with my internet, I'm working with {real_speed}, but pay for {contract_speed}, merely {percentage} |
Test: Contract_speed = 100
Real Speed | Twitter Message |
---|---|
50 | No message |
35 | Hey @MyISP, I think that something wrong with my internet, I'm working with 35Mbps, but pay for 100Mbps, merely 35% |
20 | Hey @MyISP, I think that something wrong with my internet, I'm working with 20Mbps, but pay for 100Mbps, merely 20% |
5 | My internet is terrible, only 5Mbps. I contract 120Mbps, what do you think @MyISP? |
To solve this "problem" what do you think if we change the MINIMUM_SPEED and TWEET to a list of key/value (I think in python it's tuples)?
Python can handle key/value pairs, but most of the simple and friendly data structures of config files and envvars handlers (shell envvars and .env
, for examle) cannot.
So I think either we:
.env
file for something more powerful such as .yml
or .json
(what would make us move from python-decouple
to something different in order to load configuration)But personally I would avoid this level of complexity to handle settings.
Sometimes my speed is lower than 10% that I contract.
It will be nice if the speed lower than 10% that user contract, send an twitter to @anatel.
Just for information: 😭 https://twitter.com/NicolastarziaN/status/1000489073755213825