notquiteawake / smart-aircon Goto Github PK
View Code? Open in Web Editor NEWA smart system for air conditioners, built on Arduino.
License: MIT License
A smart system for air conditioners, built on Arduino.
License: MIT License
The APIs should be renamed in an object-oriented manner.
For example:
request_* / check_* / *_req -> get_*
modify_* -> set_*
Possible reference:
https://www.jianshu.com/p/8bce70785b2f
when directly executed, hardware.py won't run properly because there are only four params (out of 8 required) at the line
run(init_state, nxt_time, expdt, tempRec)
It's obvious that the idea is more feasible that the device should be packaged and used as an independent relay between user & real air conditioner. Code should be implemented to address the identification and recording of IR signals; A physical model should also be designed.
Secondary changes will not be synced unless manually assigned of its value again.
Reference at stackoverflow
This will cause problems when predicting next turn-on time
Data is only modified offline in the activity. It should be synchronized to the server to take effect.
When trying to modify the figures by clicking on a bar, the activity crashes because in line 109, index is always equal to -1, which results in an unexpected ArrayIndexOutOfBoundsException.
The air conditioner doesn't have to be turned on an hour before. The efficiency which time calculation depends on should be calculated by this formula:
Time = Abs(TurnOnTemp - ExpectedTemp) / ConditioningTime
All users should have a share in deciding the temperature, so a weighed mean method should be added in addition to the current purely prioritized system.
Interface is not designed to be used in an intuitive and interactive manner. Require rearrangement of items.
Use encryption for communication to enhance data security.
Encountered the error:
W/OkHttpClient: A connection to (address) was leaked. Did you forget to close a response body?
Consider removal.
This helps readability and reduced user's workload.
In server.py, line 64:
elif task['cmd'] == 'modify_exp':
if mutex.acquire():
nxt_time.value = task['exp_time']
exp[nxt_time.value] = task['exp_temp']
mutex.release()
return jsonify({'status': 1})
Code means it isn't able to receive data separately.
Logcat detail
com.ota.jimmychen.ota E/WindowManager: android.view.WindowLeaked: Activity com.ota.jimmychen.ota.MainActivity has leaked window DecorView@b7c1857[] that was originally added here
at android.view.ViewRootImpl.<init>(ViewRootImpl.java:485)
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:346)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:92)
at android.app.Dialog.show(Dialog.java:330)
at android.app.AlertDialog$Builder.show(AlertDialog.java:1114)
at com.ota.jimmychen.ota.MainActivity$3.onClick(MainActivity.java:118)
at android.view.View.performClick(View.java:6256)
at android.view.View$PerformClick.run(View.java:24701)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.