Skip to content

Commit

Permalink
Added 'LCSC' property to symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
TousstNicolas committed May 5, 2022
1 parent 15eefd5 commit 4d5dce6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion JLC2KiCadLib/JLC2KiCadLib.py
Expand Up @@ -16,7 +16,7 @@ def add_component(component_id, args):
)

if not data["success"]:
logging.error("failed to get component uuid\nThe component # is probably wrong. Check a possible typo and try again")
logging.error(f"failed to get component uuid for {component_id}\nThe component # is probably wrong. Check a possible typo and that the component exists on easyEDA")
return ()

footprint_component_uuid = data["result"][-1]["component_uuid"]
Expand All @@ -41,6 +41,7 @@ def add_component(component_id, args):
datasheet_link=datasheet_link,
library_name=args.schematic_lib,
output_dir=args.output_dir,
component_id=component_id,
)


Expand Down
7 changes: 5 additions & 2 deletions JLC2KiCadLib/schematic/schematic.py
Expand Up @@ -9,15 +9,15 @@


template_lib_header = f"""\
(kicad_symbol_lib (version 20210201) (generator TousstNicolas/JLC2KiCad_lib)
(kicad_symbol_lib (version 05052022) (generator TousstNicolas/JLC2KiCad_lib)
"""

template_lib_footer = """
)"""


def create_schematic(
schematic_component_uuid, footprint_name, datasheet_link, library_name, output_dir
schematic_component_uuid, footprint_name, datasheet_link, library_name, output_dir, component_id
):
class kicad_schematic:
drawing = ""
Expand Down Expand Up @@ -82,6 +82,9 @@ class kicad_schematic:
)
(property "Datasheet" "{datasheet_link}" (id 3) (at -2.286 0.127 0)
(effects (font (size 1.27 1.27)) (justify left) hide)
)
(property "LCSC" "{component_id}" (id 4) (at 0 0 0)
(effects (font (size 1.27 1.27)))
){kicad_schematic.drawing}
)"""

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -12,7 +12,7 @@
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/TousstNicolas/JLC2KiCad_lib",
version="1.0.3",
version="1.0.4",
author="TousstNicolas",
license="MIT",
install_requires=["KicadModTree",],
Expand Down

0 comments on commit 4d5dce6

Please sign in to comment.