idotmatrix-api-client 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. idotmatrix/__init__.py +15 -0
  2. idotmatrix/apps/__init__.py +0 -0
  3. idotmatrix/apps/digital_picture_frame.py +541 -0
  4. idotmatrix/client.py +284 -0
  5. idotmatrix/connection_manager.py +702 -0
  6. idotmatrix/const.py +30 -0
  7. idotmatrix/fonts/16-ErbosDraco1StOpenNbpRegular-l5wX.ttf +0 -0
  8. idotmatrix/fonts/16-MinecraftStandard.otf +0 -0
  9. idotmatrix/fonts/16-MinecraftStandardBoldOblique.otf +0 -0
  10. idotmatrix/fonts/16-PixelOperator8-Bold.ttf +0 -0
  11. idotmatrix/fonts/16-PixelOperator8.ttf +0 -0
  12. idotmatrix/fonts/16-PixelifySans-Regular.ttf +0 -0
  13. idotmatrix/fonts/16-PressStart2P-Regular.ttf +0 -0
  14. idotmatrix/fonts/16-dogica.ttf +0 -0
  15. idotmatrix/fonts/16-dogicabold.ttf +0 -0
  16. idotmatrix/fonts/16-dogicapixel.ttf +0 -0
  17. idotmatrix/fonts/16-dogicapixelbold.ttf +0 -0
  18. idotmatrix/fonts/16_32-HomeVideo-BLG6G.ttf +0 -0
  19. idotmatrix/fonts/16_32-HomeVideoBold-R90Dv.ttf +0 -0
  20. idotmatrix/fonts/16_32-MayfairNbpBold-gAA4.ttf +0 -0
  21. idotmatrix/fonts/32-Jersey10-Regular.ttf +0 -0
  22. idotmatrix/fonts/CC-BY-SA-4.0-License.txt +428 -0
  23. idotmatrix/fonts/ErbosDraco-License.txt +3 -0
  24. idotmatrix/fonts/HomeVideo-License.txt +2 -0
  25. idotmatrix/fonts/Jersey10-Regular-License.txt +93 -0
  26. idotmatrix/fonts/MayfairNbpBold-License.txt +3 -0
  27. idotmatrix/fonts/MinecraftStandard-License.txt +5 -0
  28. idotmatrix/fonts/PixelOperator-License.txt +121 -0
  29. idotmatrix/fonts/PixelifySans-License.txt +93 -0
  30. idotmatrix/fonts/PressStart2P-Regular-License.txt +93 -0
  31. idotmatrix/fonts/Rain-DRM3-License.txt +44 -0
  32. idotmatrix/fonts/Rain-DRM3.otf +0 -0
  33. idotmatrix/fonts/dogica_license.txt +94 -0
  34. idotmatrix/modules/__init__.py +64 -0
  35. idotmatrix/modules/chronograph.py +50 -0
  36. idotmatrix/modules/clock.py +101 -0
  37. idotmatrix/modules/common.py +176 -0
  38. idotmatrix/modules/countdown.py +70 -0
  39. idotmatrix/modules/eco.py +63 -0
  40. idotmatrix/modules/effect.py +79 -0
  41. idotmatrix/modules/fullscreen_color.py +55 -0
  42. idotmatrix/modules/gif.py +403 -0
  43. idotmatrix/modules/graffiti.py +71 -0
  44. idotmatrix/modules/image.py +383 -0
  45. idotmatrix/modules/music_sync.py +67 -0
  46. idotmatrix/modules/scoreboard.py +38 -0
  47. idotmatrix/modules/system.py +65 -0
  48. idotmatrix/modules/text.py +232 -0
  49. idotmatrix/protocol.py +52 -0
  50. idotmatrix/screensize.py +8 -0
  51. idotmatrix/transport.py +137 -0
  52. idotmatrix/util/__init__.py +0 -0
  53. idotmatrix/util/color_utils.py +64 -0
  54. idotmatrix/util/command_ack.py +23 -0
  55. idotmatrix/util/device_info.py +38 -0
  56. idotmatrix/util/device_material.py +16 -0
  57. idotmatrix/util/file_watch.py +57 -0
  58. idotmatrix/util/image_utils.py +139 -0
  59. idotmatrix/util/upload_ack.py +42 -0
  60. idotmatrix_api_client-0.2.0.dist-info/METADATA +375 -0
  61. idotmatrix_api_client-0.2.0.dist-info/RECORD +63 -0
  62. idotmatrix_api_client-0.2.0.dist-info/WHEEL +4 -0
  63. idotmatrix_api_client-0.2.0.dist-info/licenses/LICENSE +674 -0
@@ -0,0 +1,121 @@
1
+ Creative Commons Legal Code
2
+
3
+ CC0 1.0 Universal
4
+
5
+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6
+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7
+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8
+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9
+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10
+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11
+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12
+ HEREUNDER.
13
+
14
+ Statement of Purpose
15
+
16
+ The laws of most jurisdictions throughout the world automatically confer
17
+ exclusive Copyright and Related Rights (defined below) upon the creator
18
+ and subsequent owner(s) (each and all, an "owner") of an original work of
19
+ authorship and/or a database (each, a "Work").
20
+
21
+ Certain owners wish to permanently relinquish those rights to a Work for
22
+ the purpose of contributing to a commons of creative, cultural and
23
+ scientific works ("Commons") that the public can reliably and without fear
24
+ of later claims of infringement build upon, modify, incorporate in other
25
+ works, reuse and redistribute as freely as possible in any form whatsoever
26
+ and for any purposes, including without limitation commercial purposes.
27
+ These owners may contribute to the Commons to promote the ideal of a free
28
+ culture and the further production of creative, cultural and scientific
29
+ works, or to gain reputation or greater distribution for their Work in
30
+ part through the use and efforts of others.
31
+
32
+ For these and/or other purposes and motivations, and without any
33
+ expectation of additional consideration or compensation, the person
34
+ associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35
+ is an owner of Copyright and Related Rights in the Work, voluntarily
36
+ elects to apply CC0 to the Work and publicly distribute the Work under its
37
+ terms, with knowledge of his or her Copyright and Related Rights in the
38
+ Work and the meaning and intended legal effect of CC0 on those rights.
39
+
40
+ 1. Copyright and Related Rights. A Work made available under CC0 may be
41
+ protected by copyright and related or neighboring rights ("Copyright and
42
+ Related Rights"). Copyright and Related Rights include, but are not
43
+ limited to, the following:
44
+
45
+ i. the right to reproduce, adapt, distribute, perform, display,
46
+ communicate, and translate a Work;
47
+ ii. moral rights retained by the original author(s) and/or performer(s);
48
+ iii. publicity and privacy rights pertaining to a person's image or
49
+ likeness depicted in a Work;
50
+ iv. rights protecting against unfair competition in regards to a Work,
51
+ subject to the limitations in paragraph 4(a), below;
52
+ v. rights protecting the extraction, dissemination, use and reuse of data
53
+ in a Work;
54
+ vi. database rights (such as those arising under Directive 96/9/EC of the
55
+ European Parliament and of the Council of 11 March 1996 on the legal
56
+ protection of databases, and under any national implementation
57
+ thereof, including any amended or successor version of such
58
+ directive); and
59
+ vii. other similar, equivalent or corresponding rights throughout the
60
+ world based on applicable law or treaty, and any national
61
+ implementations thereof.
62
+
63
+ 2. Waiver. To the greatest extent permitted by, but not in contravention
64
+ of, applicable law, Affirmer hereby overtly, fully, permanently,
65
+ irrevocably and unconditionally waives, abandons, and surrenders all of
66
+ Affirmer's Copyright and Related Rights and associated claims and causes
67
+ of action, whether now known or unknown (including existing as well as
68
+ future claims and causes of action), in the Work (i) in all territories
69
+ worldwide, (ii) for the maximum duration provided by applicable law or
70
+ treaty (including future time extensions), (iii) in any current or future
71
+ medium and for any number of copies, and (iv) for any purpose whatsoever,
72
+ including without limitation commercial, advertising or promotional
73
+ purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74
+ member of the public at large and to the detriment of Affirmer's heirs and
75
+ successors, fully intending that such Waiver shall not be subject to
76
+ revocation, rescission, cancellation, termination, or any other legal or
77
+ equitable action to disrupt the quiet enjoyment of the Work by the public
78
+ as contemplated by Affirmer's express Statement of Purpose.
79
+
80
+ 3. Public License Fallback. Should any part of the Waiver for any reason
81
+ be judged legally invalid or ineffective under applicable law, then the
82
+ Waiver shall be preserved to the maximum extent permitted taking into
83
+ account Affirmer's express Statement of Purpose. In addition, to the
84
+ extent the Waiver is so judged Affirmer hereby grants to each affected
85
+ person a royalty-free, non transferable, non sublicensable, non exclusive,
86
+ irrevocable and unconditional license to exercise Affirmer's Copyright and
87
+ Related Rights in the Work (i) in all territories worldwide, (ii) for the
88
+ maximum duration provided by applicable law or treaty (including future
89
+ time extensions), (iii) in any current or future medium and for any number
90
+ of copies, and (iv) for any purpose whatsoever, including without
91
+ limitation commercial, advertising or promotional purposes (the
92
+ "License"). The License shall be deemed effective as of the date CC0 was
93
+ applied by Affirmer to the Work. Should any part of the License for any
94
+ reason be judged legally invalid or ineffective under applicable law, such
95
+ partial invalidity or ineffectiveness shall not invalidate the remainder
96
+ of the License, and in such case Affirmer hereby affirms that he or she
97
+ will not (i) exercise any of his or her remaining Copyright and Related
98
+ Rights in the Work or (ii) assert any associated claims and causes of
99
+ action with respect to the Work, in either case contrary to Affirmer's
100
+ express Statement of Purpose.
101
+
102
+ 4. Limitations and Disclaimers.
103
+
104
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
105
+ surrendered, licensed or otherwise affected by this document.
106
+ b. Affirmer offers the Work as-is and makes no representations or
107
+ warranties of any kind concerning the Work, express, implied,
108
+ statutory or otherwise, including without limitation warranties of
109
+ title, merchantability, fitness for a particular purpose, non
110
+ infringement, or the absence of latent or other defects, accuracy, or
111
+ the present or absence of errors, whether or not discoverable, all to
112
+ the greatest extent permissible under applicable law.
113
+ c. Affirmer disclaims responsibility for clearing rights of other persons
114
+ that may apply to the Work or any use thereof, including without
115
+ limitation any person's Copyright and Related Rights in the Work.
116
+ Further, Affirmer disclaims responsibility for obtaining any necessary
117
+ consents, permissions or other rights required for any use of the
118
+ Work.
119
+ d. Affirmer understands and acknowledges that Creative Commons is not a
120
+ party to this document and has no duty or obligation with respect to
121
+ this CC0 or use of the Work.
@@ -0,0 +1,93 @@
1
+ Copyright 2021 The Pixelify Sans Project Authors (https://github.com/eifetx/Pixelify-Sans)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://openfontlicense.org
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Copyright (c) 2012, Cody "CodeMan38" Boisclair (cody@zone38.net), with Reserved Font Name "Press Start 2P"
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,44 @@
1
+ Copyright (c) 2015, Kosal Sen, Philatype (<http://philatype.com>),
2
+ with Reserved Font Name Sen.
3
+
4
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
5
+ This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
6
+
7
+ -----------------------------------------------------------
8
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
13
+
14
+ The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
15
+
16
+ DEFINITIONS
17
+ "Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
18
+
19
+ "Reserved Font Name" refers to any names specified as such after the copyright statement(s).
20
+
21
+ "Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
22
+
23
+ "Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
24
+
25
+ "Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
26
+
27
+ PERMISSION & CONDITIONS
28
+ Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
29
+
30
+ 1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
31
+
32
+ 2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
33
+
34
+ 3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
35
+
36
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
37
+
38
+ 5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
39
+
40
+ TERMINATION
41
+ This license becomes null and void if any of the above conditions are not met.
42
+
43
+ DISCLAIMER
44
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file
@@ -0,0 +1,94 @@
1
+ Copyright (c) 2020, Roberto Mocci (<patreon.com/rmocci | da.iosonor@gmail.com>),
2
+ with Reserved Font Name Dogica.
3
+
4
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
5
+ This license is copied below, and is also available with a FAQ at:
6
+ http://scripts.sil.org/OFL
7
+
8
+
9
+ -----------------------------------------------------------
10
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
11
+ -----------------------------------------------------------
12
+
13
+ PREAMBLE
14
+ The goals of the Open Font License (OFL) are to stimulate worldwide
15
+ development of collaborative font projects, to support the font creation
16
+ efforts of academic and linguistic communities, and to provide a free and
17
+ open framework in which fonts may be shared and improved in partnership
18
+ with others.
19
+
20
+ The OFL allows the licensed fonts to be used, studied, modified and
21
+ redistributed freely as long as they are not sold by themselves. The
22
+ fonts, including any derivative works, can be bundled, embedded,
23
+ redistributed and/or sold with any software provided that any reserved
24
+ names are not used by derivative works. The fonts and derivatives,
25
+ however, cannot be released under any other type of license. The
26
+ requirement for fonts to remain under this license does not apply
27
+ to any document created using the fonts or their derivatives.
28
+
29
+ DEFINITIONS
30
+ "Font Software" refers to the set of files released by the Copyright
31
+ Holder(s) under this license and clearly marked as such. This may
32
+ include source files, build scripts and documentation.
33
+
34
+ "Reserved Font Name" refers to any names specified as such after the
35
+ copyright statement(s).
36
+
37
+ "Original Version" refers to the collection of Font Software components as
38
+ distributed by the Copyright Holder(s).
39
+
40
+ "Modified Version" refers to any derivative made by adding to, deleting,
41
+ or substituting -- in part or in whole -- any of the components of the
42
+ Original Version, by changing formats or by porting the Font Software to a
43
+ new environment.
44
+
45
+ "Author" refers to any designer, engineer, programmer, technical
46
+ writer or other person who contributed to the Font Software.
47
+
48
+ PERMISSION & CONDITIONS
49
+ Permission is hereby granted, free of charge, to any person obtaining
50
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
51
+ redistribute, and sell modified and unmodified copies of the Font
52
+ Software, subject to the following conditions:
53
+
54
+ 1) Neither the Font Software nor any of its individual components,
55
+ in Original or Modified Versions, may be sold by itself.
56
+
57
+ 2) Original or Modified Versions of the Font Software may be bundled,
58
+ redistributed and/or sold with any software, provided that each copy
59
+ contains the above copyright notice and this license. These can be
60
+ included either as stand-alone text files, human-readable headers or
61
+ in the appropriate machine-readable metadata fields within text or
62
+ binary files as long as those fields can be easily viewed by the user.
63
+
64
+ 3) No Modified Version of the Font Software may use the Reserved Font
65
+ Name(s) unless explicit written permission is granted by the corresponding
66
+ Copyright Holder. This restriction only applies to the primary font name as
67
+ presented to the users.
68
+
69
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
70
+ Software shall not be used to promote, endorse or advertise any
71
+ Modified Version, except to acknowledge the contribution(s) of the
72
+ Copyright Holder(s) and the Author(s) or with their explicit written
73
+ permission.
74
+
75
+ 5) The Font Software, modified or unmodified, in part or in whole,
76
+ must be distributed entirely under this license, and must not be
77
+ distributed under any other license. The requirement for fonts to
78
+ remain under this license does not apply to any document created
79
+ using the Font Software.
80
+
81
+ TERMINATION
82
+ This license becomes null and void if any of the above conditions are
83
+ not met.
84
+
85
+ DISCLAIMER
86
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
87
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
88
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
89
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
90
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
91
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
92
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
94
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,64 @@
1
+ from asyncio import sleep
2
+ from typing import List
3
+
4
+ from idotmatrix.connection_manager import ConnectionManager
5
+
6
+
7
+ class IDotMatrixModule:
8
+
9
+ def __init__(
10
+ self,
11
+ connection_manager: ConnectionManager,
12
+ ):
13
+ self._connection_manager: ConnectionManager = connection_manager
14
+
15
+ async def _connect(self):
16
+ """Connects to the IDotMatrix device."""
17
+ await self._connection_manager.connect()
18
+
19
+ async def _send_bytes(
20
+ self,
21
+ data: bytearray | bytes,
22
+ response: bool = False,
23
+ sleep_after: float = None
24
+ ):
25
+ """
26
+ Sends raw data to the IDotMatrix device.
27
+ Args:
28
+ data (bytearray | bytes): The data to send.
29
+ response (bool, optional): Whether to expect a response from the device. Defaults to False.
30
+ sleep_after (float, optional): Time to wait after sending the data. Defaults to 0 if response=True or the
31
+ device acknowledged the command, and 0.5 seconds otherwise.
32
+ """
33
+ acknowledged = await self._connection_manager.send_bytes(data=data, response=response)
34
+ if sleep_after is None:
35
+ # the acknowledgement tells that the device is done with the command
36
+ sleep_after = 0 if (response or acknowledged is True) else 0.5
37
+
38
+ if sleep_after > 0:
39
+ # sometimes the device needs a moment to process the command before it is able to receive the next one
40
+ await sleep(sleep_after)
41
+
42
+ async def _send_packets(
43
+ self,
44
+ packets: List[List[bytearray | bytes]],
45
+ response: bool = False,
46
+ sleep_after: float = None,
47
+ wait_for_ack: bool = False,
48
+ ):
49
+ """
50
+ Sends multiple packets to the IDotMatrix device.
51
+ Args:
52
+ packets (List[List[bytearray | bytes]]): The packets to send.
53
+ response (bool, optional): Whether to expect a response from the device. Defaults to False.
54
+ sleep_after (float, optional): Time to wait after sending the packets. Defaults to 0 if response=True and 0.5 seconds if response=False.
55
+ wait_for_ack (bool, optional): Whether the device has to acknowledge each packet before the next one is sent.
56
+ Required for uploads of images and GIFs. Defaults to False.
57
+ """
58
+ if sleep_after is None:
59
+ sleep_after = 0 if response else 0.5
60
+
61
+ await self._connection_manager.send_packets(packets=packets, response=response, wait_for_ack=wait_for_ack)
62
+ if sleep_after > 0:
63
+ # sometimes the device needs a moment to process the command before it is able to receive the next one
64
+ await sleep(sleep_after)
@@ -0,0 +1,50 @@
1
+ import logging
2
+
3
+ from idotmatrix import protocol
4
+ from idotmatrix.modules import IDotMatrixModule
5
+ from idotmatrix.protocol import build_command
6
+
7
+
8
+ class ChronographModule(IDotMatrixModule):
9
+ """
10
+ This class contains the Chronograph controls for the iDotMatrix device.
11
+ """
12
+ logging = logging.getLogger(__name__)
13
+
14
+ async def reset(self):
15
+ """
16
+ Resets the Chronograph to zero.
17
+ Also shows the Chronograph on the screen, if it was not already visible.
18
+ """
19
+ await self._set_mode(0)
20
+
21
+ async def start_from_zero(self):
22
+ """
23
+ Starts the Chronograph from zero.
24
+ Also shows the Chronograph on the screen, if it was not already visible.
25
+ """
26
+ await self._set_mode(1)
27
+
28
+ async def pause(self):
29
+ """
30
+ Pauses the Chronograph.
31
+ """
32
+ await self._set_mode(2)
33
+
34
+ async def resume(self):
35
+ """
36
+ Resumes the Chronograph after it was paused.
37
+ """
38
+ await self._set_mode(3)
39
+
40
+ async def _set_mode(self, mode: int):
41
+ """
42
+ Starts/Stops the Chronograph.
43
+
44
+ Args:
45
+ mode (int): 0 = reset, 1 = (re)start, 2 = pause, 3 = continue after pause
46
+ """
47
+ if mode not in range(0, 4):
48
+ raise ValueError("Chronograph.setMode expects parameter mode to be between 0 and 3")
49
+ data: bytearray = build_command(protocol.CHRONOGRAPH, mode)
50
+ await self._send_bytes(data=data)
@@ -0,0 +1,101 @@
1
+ import logging
2
+ from asyncio import sleep
3
+ from enum import Enum
4
+ from typing import Tuple
5
+
6
+ from idotmatrix import protocol
7
+ from idotmatrix.modules import IDotMatrixModule
8
+ from idotmatrix.protocol import build_command
9
+ from idotmatrix.util import color_utils
10
+
11
+
12
+ class ClockStyle(Enum):
13
+ """Enum for the different clock styles."""
14
+
15
+ RGBSwipeOutline = 0
16
+ ChristmasTree = 1
17
+ Checkers = 2
18
+ Color = 3
19
+ Hourglass = 4
20
+ AlarmClock = 5
21
+ Outlines = 6
22
+ RGBCorners = 7
23
+
24
+
25
+ class ClockModule(IDotMatrixModule):
26
+ """This class contains the management of the iDotMatrix clock.
27
+ Based on the BleProtocolN.java file of the iDotMatrix Android App.
28
+ """
29
+
30
+ logging = logging.getLogger(__name__)
31
+
32
+ async def show(
33
+ self,
34
+ style: ClockStyle | int = ClockStyle.RGBSwipeOutline,
35
+ show_date: bool = True,
36
+ hour24: bool = True,
37
+ color: Tuple[int, int, int] | int | str | None = None,
38
+ ):
39
+ """Set the clock mode of the device.
40
+
41
+ Args:
42
+ style (int): Style of the clock.
43
+ show_date (bool): Whether the date should be shown or not. Defaults to True.
44
+ hour24 (bool): 12 or 24 hour format. Defaults to True.
45
+ color (tuple, optional): Color of the clock in RGB format. Defaults to (255, 255, 255).
46
+ """
47
+ if isinstance(style, ClockStyle):
48
+ style = style.value
49
+
50
+ if style not in range(0, 8):
51
+ raise ValueError("style must be one of the ClockStyle enum values or an integer between 0 and 7")
52
+
53
+ r, g, b = (255, 255, 255)
54
+ if color is not None:
55
+ color = color_utils.parse_color_rgb(color)
56
+ if not all(isinstance(c, int) for c in color):
57
+ raise ValueError("color must be a tuple of three integers (r, g, b)")
58
+ if not all(0 <= c < 256 for c in color):
59
+ raise ValueError("color values must be between 0 and 255")
60
+ r, g, b = color
61
+
62
+ data = self._create_payload(
63
+ style=style,
64
+ show_date=show_date,
65
+ hour24=hour24,
66
+ r=r, g=g, b=b
67
+ )
68
+ await self._send_bytes(data=data)
69
+ await sleep(0.1)
70
+
71
+ async def set_time_indicator(self, enabled: bool = True):
72
+ """
73
+ Sets the time indicator of the clock. Does not seem to work currently (maybe in a future update?).
74
+ It is inside the source code of BleProtocolN.java, but not referenced anywhere.
75
+
76
+ Args:
77
+ enabled (bool, optional): Whether to show the time indicator of the clock. Defaults to True.
78
+ """
79
+ data: bytearray = build_command(protocol.CLOCK_TIME_INDICATOR, 1 if enabled else 0)
80
+ await self._send_bytes(data=data)
81
+
82
+ @staticmethod
83
+ def _create_payload(
84
+ style: int,
85
+ show_date: bool,
86
+ hour24: bool,
87
+ r: int, g: int, b: int
88
+ ) -> bytearray:
89
+ """Create a payload for the clock settings.
90
+
91
+ Args:
92
+ style (int): Style of the clock.
93
+ show_date (bool): Whether the date should be shown or not.
94
+ hour24 (bool): 12 or 24 hour format.
95
+ r (int): Color red.
96
+ g (int): Color green.
97
+ b (int): Color blue.
98
+ """
99
+ data: bytearray = build_command(
100
+ protocol.CLOCK, (style | (128 if show_date else 0)) | (64 if hour24 else 0), r % 256, g % 256, b % 256)
101
+ return data